├── .github ├── ISSUE_TEMPLATE │ ├── bug-report.md │ └── feature-request.md └── PULL_REQUEST_TEMPLATE.md ├── .gitignore ├── CODE_OF_CONDUCT.md ├── CONTRIBUTING.md ├── LICENSE.txt ├── README.md └── samples └── postman ├── My vCenter.postman_environment.json ├── README.md ├── VMC Environment.postman_environment.json ├── VMware Cloud on AWS APIs.postman_collection.json ├── images ├── ContentLibrary_Sample.JPG ├── VMC.jpg ├── environment.jpg ├── importbutton.png ├── importdialog.png └── imported.png ├── vSphere-Automation-REST-Resources.postman_collection.json ├── vSphere-Automation-REST-resources-for-Content-Library.postman_collection.json ├── vSphere-Automation-Rest-API-Appliance-Resources.postman.json └── vSphere-Automation-Rest-API-Samples.postman.json /.github/ISSUE_TEMPLATE/bug-report.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Bug report 3 | about: Create a report to help us fix or improve an issue 4 | labels: bug 5 | assignees: jrgarcia 6 | --- 7 | 8 | ## Describe the bug 9 | 10 | _Please provide a clear and concise description of what the bug is, and the conditions when it occurs._ 11 | 12 | ## How to reproduce 13 | 14 | _Please provide as much information as possible to reproduce the issue. Reports without a clear reproduction may not be prioritized until one is provided._ 15 | 16 | ``` 17 | # minimal code to reproduce issue 18 | ``` 19 | 20 | ## Expected behavior 21 | 22 | _A clear and concise description of what you expected to happen._ 23 | 24 | ## Versions 25 | 26 | **Dev Environment:** 27 | 28 | * Postman: [e.g. 6.7.2] 29 | * vSphere Automation SDK: [e.g. 6.8.0] 30 | * OS: [e.g. macOS 10.14.3] 31 | 32 | ## Additional notes 33 | 34 | _Add any other notes about the problem here._ 35 | -------------------------------------------------------------------------------- /.github/ISSUE_TEMPLATE/feature-request.md: -------------------------------------------------------------------------------- 1 | --- 2 | name: Feature request 3 | about: Proposal for a new feature or enhancement 4 | labels: enhancement 5 | assignees: jrgarcia 6 | --- 7 | 8 | ## Summary 9 | 10 | _Summarize the request and address the questions as appropriate._ 11 | 12 | * What is the change? 13 | * Why should it go into the vSphere Automation SDK? 14 | * Does this change impact existing behaviors? If so how? 15 | * If this change introduces a new behavior, is this behavior accessible? 16 | 17 | ## Use case 18 | 19 | _Provide some specific details about how this change would improve your application and use case._ 20 | 21 | ## Examples 22 | 23 | _Are there any examples that demonstrate this feature or enhancement?_ 24 | 25 | ## Workarounds 26 | 27 | _Is there a workaround for this feature at the moment, even if it is less than ideal?_ 28 | -------------------------------------------------------------------------------- /.github/PULL_REQUEST_TEMPLATE.md: -------------------------------------------------------------------------------- 1 | **What this PR does / why we need it**: 2 | 3 | **Which issue(s) this PR fixes**: 4 | 5 | Fixes # 6 | 7 | **Special notes for your reviewer**: 8 | -------------------------------------------------------------------------------- /.gitignore: -------------------------------------------------------------------------------- 1 | # .DS_Store 2 | .DS_Store 3 | -------------------------------------------------------------------------------- /CODE_OF_CONDUCT.md: -------------------------------------------------------------------------------- 1 | # Contributor Covenant Code of Conduct 2 | 3 | ## Our Pledge 4 | 5 | In the interest of fostering an open and welcoming environment, we as 6 | contributors and maintainers pledge to making participation in our project and 7 | our community a harassment-free experience for everyone, regardless of age, body 8 | size, disability, ethnicity, sex characteristics, gender identity and expression, 9 | level of experience, education, socio-economic status, nationality, personal 10 | appearance, race, religion, or sexual identity and orientation. 11 | 12 | ## Our Standards 13 | 14 | Examples of behavior that contributes to creating a positive environment 15 | include: 16 | 17 | * Using welcoming and inclusive language 18 | * Being respectful of differing viewpoints and experiences 19 | * Gracefully accepting constructive criticism 20 | * Focusing on what is best for the community 21 | * Showing empathy towards other community members 22 | 23 | Examples of unacceptable behavior by participants include: 24 | 25 | * The use of sexualized language or imagery and unwelcome sexual attention or 26 | advances 27 | * Trolling, insulting/derogatory comments, and personal or political attacks 28 | * Public or private harassment 29 | * Publishing others' private information, such as a physical or electronic 30 | address, without explicit permission 31 | * Other conduct which could reasonably be considered inappropriate in a 32 | professional setting 33 | 34 | ## Our Responsibilities 35 | 36 | Project maintainers are responsible for clarifying the standards of acceptable 37 | behavior and are expected to take appropriate and fair corrective action in 38 | response to any instances of unacceptable behavior. 39 | 40 | Project maintainers have the right and responsibility to remove, edit, or 41 | reject comments, commits, code, wiki edits, issues, and other contributions 42 | that are not aligned to this Code of Conduct, or to ban temporarily or 43 | permanently any contributor for other behaviors that they deem inappropriate, 44 | threatening, offensive, or harmful. 45 | 46 | ## Scope 47 | 48 | This Code of Conduct applies both within project spaces and in public spaces 49 | when an individual is representing the project or its community. Examples of 50 | representing a project or community include using an official project e-mail 51 | address, posting via an official social media account, or acting as an appointed 52 | representative at an online or offline event. Representation of a project may be 53 | further defined and clarified by project maintainers. 54 | 55 | ## Enforcement 56 | 57 | Instances of abusive, harassing, or otherwise unacceptable behavior may be 58 | reported by contacting the project team at jrg@vmware.com and/or strefethen@vmware.com. All 59 | complaints will be reviewed and investigated and will result in a response that 60 | is deemed necessary and appropriate to the circumstances. The project team is 61 | obligated to maintain confidentiality with regard to the reporter of an incident. 62 | Further details of specific enforcement policies may be posted separately. 63 | 64 | Project maintainers who do not follow or enforce the Code of Conduct in good 65 | faith may face temporary or permanent repercussions as determined by other 66 | members of the project's leadership. 67 | 68 | ## Attribution 69 | 70 | This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4, 71 | available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html 72 | 73 | [homepage]: https://www.contributor-covenant.org 74 | 75 | For answers to common questions about this code of conduct, see 76 | https://www.contributor-covenant.org/faq 77 | -------------------------------------------------------------------------------- /CONTRIBUTING.md: -------------------------------------------------------------------------------- 1 | # Contributing 2 | 3 | ## Submitting samples 4 | 5 | ### Developer Certificate of Origin 6 | 7 | Before you start working with this project, please read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. 8 | 9 | ### Required Information 10 | The following information must be included in the README.md or in the sample docstring in case a README already exists in same folder. 11 | * Author Name 12 | * This can include full name, email address or other identifiable piece of information that would allow interested parties to contact author with questions. 13 | * Date 14 | * Date the sample was originally written 15 | * Minimal/High Level Description 16 | * What does the sample do? 17 | * Any KNOWN limitations or dependencies 18 | 19 | ### Suggested Information 20 | The following information should be included when possible. Inclusion of information provides valuable information to consumers of the resource. 21 | * vSphere version against which the sample was developed/tested 22 | * SDK version against which the sample was developed/tested 23 | * Additional Version information for any dependencies against which the sample was developed/tested 24 | 25 | ### Contribution Process 26 | 27 | * Follow the [GitHub process](https://help.github.com/articles/fork-a-repo) 28 | * Please use one branch per sample or change-set 29 | * Please use one commit and pull request per sample 30 | * Please post the sample output along with the pull request 31 | * If you include a license with your sample, use the project license 32 | 33 | ## Resource Maintenance 34 | ### Maintenance Ownership 35 | Ownership of any and all submitted samples are maintained by the submitter. 36 | 37 | ### Filing Issues 38 | Any bugs or other issues should be filed within GitHub by way of the repository’s Issue Tracker. 39 | 40 | ### Resolving Issues 41 | Any community member can resolve issues within the repository, however only the board member can approve the update. Once approved, assuming the resolution involves a pull request, only a board member will be able to merge and close the request. 42 | 43 | 44 | -------------------------------------------------------------------------------- /LICENSE.txt: -------------------------------------------------------------------------------- 1 | The MIT License 2 | 3 | Copyright 2017-2020 VMware Inc. 4 | 5 | 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: 6 | 7 | The above copyright notice and this permission notice shall be included in all copies or substantial portions of the Software. 8 | 9 | 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. 10 | -------------------------------------------------------------------------------- /README.md: -------------------------------------------------------------------------------- 1 | # Discontinued! 2 | 3 | The vsphere-automation-sdk-rest has been discontinued. This repo is a READ ONLY repo. Refer below links for REST API documentation and Postman samples. 4 | 5 | [REST API Documentation](https://developer.vmware.com/docs/vsphere-automation/latest/) 6 | 7 | [vSphere Automation REST API Postman Resources and Samples](https://code.vmware.com/samples/2562) 8 | 9 | # VMware vSphere Automation SDK for REST 10 | 11 | ## Table of Contents 12 | - [Abstract](#abstract) 13 | - [Intended Audience](#intended-audience) 14 | - [What’s in the SDK?](#whats-in-the-sdk) 15 | - [Submitting samples](#submitting-samples) 16 | - [Required Information](#required-information) 17 | - [Suggested Information](#suggested-information) 18 | - [Contribution Process](#contribution-process) 19 | - [Code Style](#code-style) 20 | - [Resource Maintenance](#resource-maintenance) 21 | - [Maintenance Ownership](#maintenance-ownership) 22 | - [Filing Issues](#filing-issues) 23 | - [Resolving Issues](#resolving-issues) 24 | - [VMware Sample Exchange](#vmware-sample-exchange) 25 | - [Repository Administrator Resources](#repository-administrator-resources) 26 | - [Board Members](#board-members) 27 | - [Approval of Additions](#approval-of-additions) 28 | - [VMware Resources](#vmware-resources) 29 | 30 | ## Abstract 31 | The VMware vSphere Automation SDK for REST enables programmatic access to vSphere. The SDK includes [Postman](https://www.getpostman.com/) examples. 32 | 33 | ## Supported vCenter Releases: 34 | 35 | All samples support vCenter 6.7. Tagging samples also support vCenter 6.0. 36 | 37 | ## Intended Audience 38 | 39 | The VMware vSphere Automation SDK for REST is intended for the following audiences: 40 | 41 | * Developers looking for REST samples for the REST APIs 42 | 43 | ## What’s in the SDK? 44 | 45 | The VMware vSphere Automation SDK for REST provides a client SDK that contains samples that demonstrate how to use the vSphere Automation REST API and sample code. The following table contains a brief description of the contents of the vSphere Automation SDK for REST. 46 | 47 | Directory structure (under VMware-vSphere-Automation-SDK-REST): 48 | 49 | |Directory |Contents | 50 | |-----------------------------------|-----------------------------------------------------------------------------------------------------| 51 | |[samples/postman](samples/postman) | Postman samples that demonstrate how to construct REST API requests for Virtual Machine Operations. | 52 | 53 | ## Submitting samples 54 | 55 | ### Developer Certificate of Origin 56 | 57 | Before you start working with this project, please read our [Developer Certificate of Origin](https://cla.vmware.com/dco). All contributions to this repository must be signed as described on that page. Your signature certifies that you wrote the patch or have the right to pass it on as an open-source patch. 58 | 59 | ### Required Information 60 | The following information must be included in the README.md or in the sample docstring in case a README already exists in same folder. 61 | * Author Name 62 | * This can include full name, email address or other identifiable piece of information that would allow interested parties to contact author with questions. 63 | * Date 64 | * Date the sample was originally written 65 | * Minimal/High Level Description 66 | * What does the sample do? 67 | * Any KNOWN limitations or dependencies 68 | 69 | ### Suggested Information 70 | The following information should be included when possible. Inclusion of information provides valuable information to consumers of the resource. 71 | * vSphere version against which the sample was developed/tested 72 | * SDK version against which the sample was developed/tested 73 | * Additional Version information for any dependencies against which the sample was developed/tested 74 | 75 | ### Contribution Process 76 | 77 | * Follow the [GitHub process](https://help.github.com/articles/fork-a-repo) 78 | * Please use one branch per sample or change-set 79 | * Please use one commit and pull request per sample 80 | * Please post the sample output along with the pull request 81 | * If you include a license with your sample, use the project license 82 | 83 | ## Resource Maintenance 84 | ### Maintenance Ownership 85 | Ownership of any and all submitted samples are maintained by the submitter. 86 | 87 | ### Filing Issues 88 | Any bugs or other issues should be filed within GitHub by way of the repository’s Issue Tracker. 89 | 90 | ### Resolving Issues 91 | Any community member can resolve issues within the repository, however only the board member can approve the update. Once approved, assuming the resolution involves a pull request, only a board member will be able to merge and close the request. 92 | 93 | ### VMware Sample Exchange 94 | It is highly recommended to add any and all submitted samples to the VMware Sample Exchange: 95 | 96 | Sample Exchange can be allowed to access your GitHub resources, by way of a linking process, where they can be indexed and searched by the community. There are VMware social media accounts which will advertise resources posted to the site and there's no additional accounts needed, as the VMware Sample Exchange uses MyVMware credentials. 97 | 98 | ## Repository Administrator Resources 99 | ### Board Members 100 | 101 | Board members are volunteers from the SDK community and VMware staff members, board members are not held responsible for any issues which may occur from running of samples from this repository. 102 | 103 | Members: 104 | * Ravi Chadalawada (VMware) 105 | * J.R. Garcia (VMware) 106 | 107 | ### Approval of Additions 108 | Items added to the repository, including items from the Board members, require 2 votes from the board members before being added to the repository. The approving members will have ideally downloaded and tested the item. When two “Approved for Merge” comments are added from board members, the pull can then be committed to the repository. 109 | 110 | ## VMware Resources 111 | 112 | * [vSphere Automation SDK Overview](http://pubs.vmware.com/vsphere-65/index.jsp#com.vmware.vapi.progguide.doc/GUID-AF73991C-FC1C-47DF-8362-184B6544CFDE.html) 113 | * [Getting Started Blog post](https://blogs.vmware.com/code/2017/02/02/getting-started-vsphere-automation-sdk-rest/) 114 | * [VMware Code](https://code.vmware.com/home) 115 | * [VMware Developer Community](https://communities.vmware.com/community/vmtn/developer) 116 | * VMware vSphere [REST API Reference documentation](https://developer.vmware.com/docs/vsphere-automation/latest/). 117 | * VMware VMC [REST API Reference documentation](https://developer.vmware.com/docs/vmc/latest/). 118 | * [VMware REST forum](https://code.vmware.com/forums/7506/vsphere-automation-sdk-for-rest) 119 | -------------------------------------------------------------------------------- /samples/postman/My vCenter.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "7906bd57-46ad-e06d-5047-2640059674fa", 3 | "name": "My vCenter", 4 | "values": [ 5 | { 6 | "enabled": true, 7 | "key": "vc", 8 | "value": "192.168.1.200", 9 | "type": "text" 10 | }, 11 | { 12 | "enabled": true, 13 | "key": "user", 14 | "value": "administrator@vsphere.local", 15 | "type": "text" 16 | }, 17 | { 18 | "enabled": true, 19 | "key": "password", 20 | "value": "Admin!23", 21 | "type": "text" 22 | }, 23 | { 24 | "enabled": true, 25 | "key": "host1", 26 | "value": "", 27 | "type": "text" 28 | }, 29 | { 30 | "enabled": true, 31 | "key": "host2", 32 | "value": "", 33 | "type": "text" 34 | }, 35 | { 36 | "enabled": true, 37 | "key": "host1pass", 38 | "value": "", 39 | "type": "text" 40 | }, 41 | { 42 | "enabled": true, 43 | "key": "host2pass", 44 | "value": "", 45 | "type": "text" 46 | } 47 | ], 48 | "timestamp": 1491517592247, 49 | "_postman_variable_scope": "environment", 50 | "_postman_exported_at": "2017-04-06T22:26:36.174Z", 51 | "_postman_exported_using": "Postman/4.10.5" 52 | } -------------------------------------------------------------------------------- /samples/postman/README.md: -------------------------------------------------------------------------------- 1 | # vSphere and VMware Cloud on AWS API Postman Resources and Samples 2 | 3 | These three files provide API resources and example end to end scenarios that you 4 | can import in to Postman to execute. 5 | 6 | * [vSphere-Automation-REST-Resources.postman_collection.json](vSphere-Automation-REST-Resources.postman_collection.json) provides the 7 | individual API resources. They are standalone requests that you can execute or use to build up an end to end workflow. 8 | * The [vSphere-Automation-Rest-API-Samples.postman.json](vSphere-Automation-Rest-API-Samples.postman.json) do 9 | exactly that to show some common simple use cases. 10 | * The [vSphere-Automation-Rest-API-Appliance-Resources.postman.json](vSphere-Automation-Rest-API-Appliance-Resources.postman.json) 11 | provides individual API resources to manage vCenter Server Appliance. They are standalone requests that you can execute 12 | or use to build up an end to end workflow. 13 | * The [vSphere-Automation-REST-resources-for-Content-Library.postman_collection.json](vSphere-Automation-REST-resources-for-Content-Library.postman_collection.json) 14 | provides individual API resources to manage vCenter Content Library features. They are standalone requests that you can execute 15 | or use to build up an end to end workflow. 16 | * The [VMware Cloud on AWS APIs.postman_collection.json](VMware%20Cloud%20on%20AWS%20APIs.postman_collection.json) 17 | provides individual API resources to manage VMware Cloud on AWS features. They are standalone requests that you can execute 18 | or use to build up an end to end workflow. 19 | 20 | ## Requirements 21 | [Postman Client](https://www.getpostman.com) 22 | 23 | ## Installation 24 | 25 | The included .json files were built using the Postman client. It is recommended that you install the latest client from [Postman](https://www.getpostman.com). 26 | 27 | Once installed, start Postman, and select the import button in the upper left corner: 28 | 29 | ![import button](images/importbutton.png "Import button") 30 | 31 | 32 | You will see the import dialog open: 33 | 34 | ![import dialog](images/importdialog.png "Import dialog") 35 | 36 | You can drag and drop the JSON files in this directory one at a time on to the 37 | dialog area where is says Drop files here or you can select the Choose files 38 | button to open a file chooser dialog and navigate to the location on your system 39 | where this directory resides, and select the JSON files. 40 | 41 | The JSON files include both the API collections and also a default "Environment" that can be altered so that each of the API collections works against your own environment. 42 | 43 | Once imported, you will see something similar to: 44 | 45 | ![imported](images/imported.png "Imported") 46 | 47 | Firstly you will need to adjust the imported environment to work with your vCenter Server, to do this click the eye icon near the top right and click the "edit" button to edit the "My vCenter" environment. Replace the values for each item to reflect the test vCenter you will be working with. As a minimum for most samples to work you will need to alter details for VC, User and password providing SSO credentials here. 48 | 49 | ![Environment](images/environment.jpg "Environment") 50 | 51 | From here, you can expand either the resources to see the individual API surfaces 52 | or expand the samples and see some of the ways you can string together the 53 | individual resources to make a use case. 54 | 55 | Content Library samples: 56 | 57 | ![Content Library Samples](images/ContentLibrary_Sample.JPG "Content Library") 58 | 59 | VMware Cloud on AWS samples: 60 | 61 | ![VMware Cloud on AWS Samples](images/VMC.jpg "VMware Cloud on AWS") 62 | 63 | To work with the VMware Cloud on AWS Samples follow these steps: 64 | 1. Import the sample file from this repository into Postman 65 | 2. Import the VMC Environment sample from this repository into Postman 66 | 3. From the VMC Console click your name at the top right of the console window, click "OAuth Refresh Token", from this page, generate or copy your refresh token. 67 | 4. Edit the "VMC Environment" in Postman and set the refresh_token value to the previously copied item. 68 | 5. Use the samples starting with Authentication - Login action. 69 | * The Org and SDDC will be automatically stored as environmental variables for future API calls once the samples are run, see the Tests tab for how this is done on each call. 70 | -------------------------------------------------------------------------------- /samples/postman/VMC Environment.postman_environment.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "7f24abc3-0274-4e68-8aa9-9167eb454d54", 3 | "name": "VMC Environment", 4 | "values": [ 5 | { 6 | "key": "refresh_token", 7 | "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 8 | "enabled": true, 9 | "type": "text" 10 | }, 11 | { 12 | "key": "sddcid", 13 | "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 14 | "enabled": true, 15 | "type": "text" 16 | }, 17 | { 18 | "key": "clusterid", 19 | "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 20 | "enabled": true, 21 | "type": "text" 22 | }, 23 | { 24 | "key": "orgid", 25 | "value": "xxxxxxxx-xxxx-xxxx-xxxx-xxxxxxxxxxxx", 26 | "enabled": true, 27 | "type": "text" 28 | } 29 | ], 30 | "_postman_variable_scope": "environment", 31 | "_postman_exported_at": "2018-07-17T21:47:45.600Z", 32 | "_postman_exported_using": "Postman/6.1.4" 33 | } 34 | -------------------------------------------------------------------------------- /samples/postman/images/ContentLibrary_Sample.JPG: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/ContentLibrary_Sample.JPG -------------------------------------------------------------------------------- /samples/postman/images/VMC.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/VMC.jpg -------------------------------------------------------------------------------- /samples/postman/images/environment.jpg: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/environment.jpg -------------------------------------------------------------------------------- /samples/postman/images/importbutton.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/importbutton.png -------------------------------------------------------------------------------- /samples/postman/images/importdialog.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/importdialog.png -------------------------------------------------------------------------------- /samples/postman/images/imported.png: -------------------------------------------------------------------------------- https://raw.githubusercontent.com/vmware-archive/vsphere-automation-sdk-rest/43dfa4fc8af167fe244952515d0d02347454357c/samples/postman/images/imported.png -------------------------------------------------------------------------------- /samples/postman/vSphere-Automation-REST-Resources.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "info": { 3 | "_postman_id": "0e09998c-6380-4079-847d-d1f894ec0128", 4 | "name": "vSphere Automation REST Resources", 5 | "description": "The folders within this collection represent the Rest API resources and the different operations that can be performed on each. These are individual requests. In many cases, each request will require input that would come from other requests. It is left up to the user to insert the correct data into the URL, query parameters and request bodies for the requests to work correctly. Refer to the ReST API Documentation for further help.", 6 | "schema": "https://schema.getpostman.com/json/collection/v2.1.0/collection.json" 7 | }, 8 | "item": [ 9 | { 10 | "name": "Authentication", 11 | "item": [ 12 | { 13 | "name": "Login", 14 | "event": [ 15 | { 16 | "listen": "test", 17 | "script": { 18 | "type": "text/javascript", 19 | "exec": [ 20 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 21 | ] 22 | } 23 | } 24 | ], 25 | "request": { 26 | "auth": { 27 | "type": "basic", 28 | "basic": [ 29 | { 30 | "key": "username", 31 | "value": "{{user}}", 32 | "type": "string" 33 | }, 34 | { 35 | "key": "password", 36 | "value": "{{password}}", 37 | "type": "string" 38 | }, 39 | { 40 | "key": "saveHelperData", 41 | "value": true, 42 | "type": "boolean" 43 | }, 44 | { 45 | "key": "showPassword", 46 | "value": false, 47 | "type": "boolean" 48 | } 49 | ] 50 | }, 51 | "method": "POST", 52 | "header": [ 53 | { 54 | "key": "Authorization", 55 | "value": "Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz" 56 | } 57 | ], 58 | "body": { 59 | "mode": "formdata", 60 | "formdata": [] 61 | }, 62 | "url": { 63 | "raw": "https://{{vc}}/rest/com/vmware/cis/session", 64 | "protocol": "https", 65 | "host": [ 66 | "{{vc}}" 67 | ], 68 | "path": [ 69 | "rest", 70 | "com", 71 | "vmware", 72 | "cis", 73 | "session" 74 | ] 75 | }, 76 | "description": "Login to the specified vCenter and retrieve a session" 77 | }, 78 | "response": [] 79 | }, 80 | { 81 | "name": "Login with SAML bearer token", 82 | "event": [ 83 | { 84 | "listen": "test", 85 | "script": { 86 | "id": "ad93d02b-7d34-494c-b581-5df0eeaf67ff", 87 | "exec": [ 88 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 89 | ], 90 | "type": "text/javascript" 91 | } 92 | } 93 | ], 94 | "request": { 95 | "auth": { 96 | "type": "noauth" 97 | }, 98 | "method": "POST", 99 | "header": [ 100 | { 101 | "key": "Authorization", 102 | "value": "SIGN token=\"{{saml_bearer_token}}\"", 103 | "description": "The SAML bearer token must be gzipped and base64 encoded before using it.", 104 | "type": "text" 105 | } 106 | ], 107 | "url": { 108 | "raw": "https://{{vc}}/rest/com/vmware/cis/session", 109 | "protocol": "https", 110 | "host": [ 111 | "{{vc}}" 112 | ], 113 | "path": [ 114 | "rest", 115 | "com", 116 | "vmware", 117 | "cis", 118 | "session" 119 | ] 120 | }, 121 | "description": "Login to the specified vCenter and retrieve a session using a SAML bearer token. The SAML bearer token _must_ be gzipped and base64 encoded before being used." 122 | }, 123 | "response": [] 124 | }, 125 | { 126 | "name": "Logout", 127 | "event": [ 128 | { 129 | "listen": "test", 130 | "script": { 131 | "type": "text/javascript", 132 | "exec": [ 133 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 134 | ] 135 | } 136 | } 137 | ], 138 | "request": { 139 | "method": "DELETE", 140 | "header": [], 141 | "body": { 142 | "mode": "formdata", 143 | "formdata": [] 144 | }, 145 | "url": { 146 | "raw": "https://{{vc}}/rest/com/vmware/cis/session", 147 | "protocol": "https", 148 | "host": [ 149 | "{{vc}}" 150 | ], 151 | "path": [ 152 | "rest", 153 | "com", 154 | "vmware", 155 | "cis", 156 | "session" 157 | ] 158 | }, 159 | "description": "Logout of the specified vCenter" 160 | }, 161 | "response": [] 162 | } 163 | ], 164 | "description": "This collection of requests shows how to log in and log out." 165 | }, 166 | { 167 | "name": "Datacenters", 168 | "item": [ 169 | { 170 | "name": "List", 171 | "request": { 172 | "method": "GET", 173 | "header": [], 174 | "url": { 175 | "raw": "https://{{vc}}/rest/vcenter/datacenter", 176 | "protocol": "https", 177 | "host": [ 178 | "{{vc}}" 179 | ], 180 | "path": [ 181 | "rest", 182 | "vcenter", 183 | "datacenter" 184 | ] 185 | }, 186 | "description": "This request will list all the datacenters. " 187 | }, 188 | "response": [] 189 | }, 190 | { 191 | "name": "Find", 192 | "request": { 193 | "method": "GET", 194 | "header": [ 195 | { 196 | "key": "Content-Type", 197 | "value": "application/json" 198 | } 199 | ], 200 | "url": { 201 | "raw": "https://{{vc}}/rest/vcenter/datacenter?filter.names.1=Testbed-DC", 202 | "protocol": "https", 203 | "host": [ 204 | "{{vc}}" 205 | ], 206 | "path": [ 207 | "rest", 208 | "vcenter", 209 | "datacenter" 210 | ], 211 | "query": [ 212 | { 213 | "key": "filter.names.1", 214 | "value": "Testbed-DC" 215 | } 216 | ] 217 | }, 218 | "description": "This call will find the Testbed-DC datacenter created in the setup sample" 219 | }, 220 | "response": [] 221 | }, 222 | { 223 | "name": "Details", 224 | "request": { 225 | "method": "GET", 226 | "header": [], 227 | "url": { 228 | "raw": "https://{{vc}}/rest/vcenter/datacenter/datacenter-87", 229 | "protocol": "https", 230 | "host": [ 231 | "{{vc}}" 232 | ], 233 | "path": [ 234 | "rest", 235 | "vcenter", 236 | "datacenter", 237 | "datacenter-87" 238 | ] 239 | }, 240 | "description": "List the details of the specified datacenter. " 241 | }, 242 | "response": [] 243 | }, 244 | { 245 | "name": "Delete", 246 | "request": { 247 | "method": "DELETE", 248 | "header": [], 249 | "body": { 250 | "mode": "raw", 251 | "raw": "" 252 | }, 253 | "url": { 254 | "raw": "https://{{vc}}/rest/vcenter/datacenter/datacenter-34", 255 | "protocol": "https", 256 | "host": [ 257 | "{{vc}}" 258 | ], 259 | "path": [ 260 | "rest", 261 | "vcenter", 262 | "datacenter", 263 | "datacenter-34" 264 | ] 265 | }, 266 | "description": "Delete the specified datacenter. " 267 | }, 268 | "response": [] 269 | }, 270 | { 271 | "name": "Create", 272 | "request": { 273 | "method": "POST", 274 | "header": [ 275 | { 276 | "key": "Content-Type", 277 | "value": "application/json" 278 | } 279 | ], 280 | "body": { 281 | "mode": "raw", 282 | "raw": "{\r\n \"spec\": {\r\n \"name\": \"DC01\",\r\n \"folder\": \"group-d1\"\r\n }\r\n}" 283 | }, 284 | "url": { 285 | "raw": "https://{{vc}}/rest/vcenter/datacenter", 286 | "protocol": "https", 287 | "host": [ 288 | "{{vc}}" 289 | ], 290 | "path": [ 291 | "rest", 292 | "vcenter", 293 | "datacenter" 294 | ] 295 | }, 296 | "description": "Create a new datacenter. Specify the name and the folder for the datacenter to be created in as part of the request body." 297 | }, 298 | "response": [] 299 | } 300 | ] 301 | }, 302 | { 303 | "name": "Datastores", 304 | "item": [ 305 | { 306 | "name": "List", 307 | "request": { 308 | "method": "GET", 309 | "header": [], 310 | "url": { 311 | "raw": "https://{{vc}}/rest/vcenter/datastore", 312 | "protocol": "https", 313 | "host": [ 314 | "{{vc}}" 315 | ], 316 | "path": [ 317 | "rest", 318 | "vcenter", 319 | "datastore" 320 | ] 321 | }, 322 | "description": "List Datastores" 323 | }, 324 | "response": [] 325 | }, 326 | { 327 | "name": "Find", 328 | "request": { 329 | "method": "GET", 330 | "header": [ 331 | { 332 | "key": "Content-Type", 333 | "value": "application/json" 334 | } 335 | ], 336 | "url": { 337 | "raw": "https://{{vc}}/rest/vcenter/datastore?filter.names.1=datastore1", 338 | "protocol": "https", 339 | "host": [ 340 | "{{vc}}" 341 | ], 342 | "path": [ 343 | "rest", 344 | "vcenter", 345 | "datastore" 346 | ], 347 | "query": [ 348 | { 349 | "key": "filter.names.1", 350 | "value": "datastore1" 351 | } 352 | ] 353 | }, 354 | "description": "Find Datastores with given filter details" 355 | }, 356 | "response": [] 357 | }, 358 | { 359 | "name": "List details for a single datastore", 360 | "request": { 361 | "method": "GET", 362 | "header": [], 363 | "url": { 364 | "raw": "https://{{vc}}/rest/vcenter/datastore/datastore-26", 365 | "protocol": "https", 366 | "host": [ 367 | "{{vc}}" 368 | ], 369 | "path": [ 370 | "rest", 371 | "vcenter", 372 | "datastore", 373 | "datastore-26" 374 | ] 375 | }, 376 | "description": "List details for a datastore" 377 | }, 378 | "response": [] 379 | } 380 | ] 381 | }, 382 | { 383 | "name": "Folders", 384 | "item": [ 385 | { 386 | "name": "List", 387 | "request": { 388 | "method": "GET", 389 | "header": [], 390 | "url": { 391 | "raw": "https://{{vc}}/rest/vcenter/folder", 392 | "protocol": "https", 393 | "host": [ 394 | "{{vc}}" 395 | ], 396 | "path": [ 397 | "rest", 398 | "vcenter", 399 | "folder" 400 | ] 401 | }, 402 | "description": "List Folder IDs" 403 | }, 404 | "response": [] 405 | }, 406 | { 407 | "name": "Find", 408 | "request": { 409 | "method": "GET", 410 | "header": [ 411 | { 412 | "key": "Content-Type", 413 | "value": "application/json" 414 | } 415 | ], 416 | "url": { 417 | "raw": "https://{{vc}}/rest/vcenter/folder?filter.type=VIRTUAL_MACHINE&filter.names.1=Discovered virtual machine", 418 | "protocol": "https", 419 | "host": [ 420 | "{{vc}}" 421 | ], 422 | "path": [ 423 | "rest", 424 | "vcenter", 425 | "folder" 426 | ], 427 | "query": [ 428 | { 429 | "key": "filter.type", 430 | "value": "VIRTUAL_MACHINE" 431 | }, 432 | { 433 | "key": "filter.names.1", 434 | "value": "Discovered virtual machine" 435 | } 436 | ] 437 | }, 438 | "description": "Find Folders with given filter details" 439 | }, 440 | "response": [] 441 | } 442 | ] 443 | }, 444 | { 445 | "name": "Hosts", 446 | "item": [ 447 | { 448 | "name": "List", 449 | "request": { 450 | "method": "GET", 451 | "header": [], 452 | "url": { 453 | "raw": "https://{{vc}}/rest/vcenter/host", 454 | "protocol": "https", 455 | "host": [ 456 | "{{vc}}" 457 | ], 458 | "path": [ 459 | "rest", 460 | "vcenter", 461 | "host" 462 | ] 463 | }, 464 | "description": "List all the hosts available." 465 | }, 466 | "response": [] 467 | }, 468 | { 469 | "name": "Add", 470 | "request": { 471 | "method": "POST", 472 | "header": [ 473 | { 474 | "key": "Content-Type", 475 | "value": "application/json" 476 | } 477 | ], 478 | "body": { 479 | "mode": "raw", 480 | "raw": "{\n \"spec\": {\n \"force_add\": true,\n \"folder\": \"group-h4\",\n \"hostname\": \"{{host1}}\",\n \"user_name\": \"root\",\n \"password\": \"{{host1pass}}\",\n \"port\": 443,\n \"thumbprint_verification\": \"NONE\"\n }\n}" 481 | }, 482 | "url": { 483 | "raw": "https://{{vc}}/rest/vcenter/host", 484 | "protocol": "https", 485 | "host": [ 486 | "{{vc}}" 487 | ], 488 | "path": [ 489 | "rest", 490 | "vcenter", 491 | "host" 492 | ] 493 | }, 494 | "description": "Add a new host to the specified folder" 495 | }, 496 | "response": [] 497 | }, 498 | { 499 | "name": "Connect", 500 | "request": { 501 | "method": "POST", 502 | "header": [], 503 | "body": { 504 | "mode": "raw", 505 | "raw": "" 506 | }, 507 | "url": { 508 | "raw": "https://{{vc}}/rest/vcenter/host/host-10/connect", 509 | "protocol": "https", 510 | "host": [ 511 | "{{vc}}" 512 | ], 513 | "path": [ 514 | "rest", 515 | "vcenter", 516 | "host", 517 | "host-10", 518 | "connect" 519 | ] 520 | }, 521 | "description": "Connect a disconnected host" 522 | }, 523 | "response": [] 524 | }, 525 | { 526 | "name": "Disconnect", 527 | "request": { 528 | "method": "POST", 529 | "header": [], 530 | "body": { 531 | "mode": "raw", 532 | "raw": "" 533 | }, 534 | "url": { 535 | "raw": "https://{{vc}}/rest/vcenter/host/host-10/disconnect", 536 | "protocol": "https", 537 | "host": [ 538 | "{{vc}}" 539 | ], 540 | "path": [ 541 | "rest", 542 | "vcenter", 543 | "host", 544 | "host-10", 545 | "disconnect" 546 | ] 547 | }, 548 | "description": "Disconnect a connected host" 549 | }, 550 | "response": [] 551 | }, 552 | { 553 | "name": "Delete", 554 | "request": { 555 | "method": "DELETE", 556 | "header": [ 557 | { 558 | "key": "Content-Type", 559 | "value": "application/json" 560 | } 561 | ], 562 | "body": { 563 | "mode": "raw", 564 | "raw": "" 565 | }, 566 | "url": { 567 | "raw": "https://{{vc}}/rest/vcenter/host/host-12", 568 | "protocol": "https", 569 | "host": [ 570 | "{{vc}}" 571 | ], 572 | "path": [ 573 | "rest", 574 | "vcenter", 575 | "host", 576 | "host-12" 577 | ] 578 | }, 579 | "description": "Remove the specified standalone host" 580 | }, 581 | "response": [] 582 | } 583 | ], 584 | "description": "The requests in this collection can be called independently. Each request may require various bits of data such as the host name." 585 | }, 586 | { 587 | "name": "Network", 588 | "item": [ 589 | { 590 | "name": "List details", 591 | "request": { 592 | "method": "GET", 593 | "header": [], 594 | "url": { 595 | "raw": "https://{{vc}}/rest/vcenter/network", 596 | "protocol": "https", 597 | "host": [ 598 | "{{vc}}" 599 | ], 600 | "path": [ 601 | "rest", 602 | "vcenter", 603 | "network" 604 | ] 605 | }, 606 | "description": "This request will get the list of all networks available." 607 | }, 608 | "response": [] 609 | } 610 | ] 611 | }, 612 | { 613 | "name": "Resource Pool", 614 | "item": [ 615 | { 616 | "name": "List", 617 | "request": { 618 | "method": "GET", 619 | "header": [], 620 | "url": { 621 | "raw": "https://{{vc}}/rest/vcenter/resource-pool", 622 | "protocol": "https", 623 | "host": [ 624 | "{{vc}}" 625 | ], 626 | "path": [ 627 | "rest", 628 | "vcenter", 629 | "resource-pool" 630 | ] 631 | }, 632 | "description": "This call will return a list of resource pools" 633 | }, 634 | "response": [] 635 | }, 636 | { 637 | "name": "Get details", 638 | "request": { 639 | "method": "GET", 640 | "header": [], 641 | "url": { 642 | "raw": "https://{{vc}}/rest/vcenter/resource-pool/resgroup-8", 643 | "protocol": "https", 644 | "host": [ 645 | "{{vc}}" 646 | ], 647 | "path": [ 648 | "rest", 649 | "vcenter", 650 | "resource-pool", 651 | "resgroup-8" 652 | ] 653 | }, 654 | "description": "This request will return the details of the specified resource pool." 655 | }, 656 | "response": [] 657 | }, 658 | { 659 | "name": "Find ResourcePool for host1", 660 | "request": { 661 | "method": "GET", 662 | "header": [], 663 | "url": { 664 | "raw": "https://{{vc}}/rest/vcenter/resource-pool?filter.names.1=Resources&filter.hosts.1=", 665 | "protocol": "https", 666 | "host": [ 667 | "{{vc}}" 668 | ], 669 | "path": [ 670 | "rest", 671 | "vcenter", 672 | "resource-pool" 673 | ], 674 | "query": [ 675 | { 676 | "key": "filter.names.1", 677 | "value": "Resources" 678 | }, 679 | { 680 | "key": "filter.hosts.1", 681 | "value": "" 682 | } 683 | ] 684 | }, 685 | "description": "This call will return a list of resource pools" 686 | }, 687 | "response": [] 688 | } 689 | ], 690 | "description": "Individual requests for the Resource Pool resource" 691 | }, 692 | { 693 | "name": "VM", 694 | "item": [ 695 | { 696 | "name": "List", 697 | "request": { 698 | "method": "GET", 699 | "header": [], 700 | "url": { 701 | "raw": "https://{{vc}}/rest/vcenter/vm", 702 | "protocol": "https", 703 | "host": [ 704 | "{{vc}}" 705 | ], 706 | "path": [ 707 | "rest", 708 | "vcenter", 709 | "vm" 710 | ] 711 | }, 712 | "description": "List all available VMs" 713 | }, 714 | "response": [] 715 | }, 716 | { 717 | "name": "Details", 718 | "request": { 719 | "method": "GET", 720 | "header": [], 721 | "url": { 722 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-22", 723 | "protocol": "https", 724 | "host": [ 725 | "{{vc}}" 726 | ], 727 | "path": [ 728 | "rest", 729 | "vcenter", 730 | "vm", 731 | "vm-22" 732 | ] 733 | }, 734 | "description": "Get the details for the specified VM" 735 | }, 736 | "response": [] 737 | }, 738 | { 739 | "name": "Find", 740 | "request": { 741 | "method": "GET", 742 | "header": [], 743 | "url": { 744 | "raw": "https://{{vc}}/rest/vcenter/vm?filter.names.1=MyVM", 745 | "protocol": "https", 746 | "host": [ 747 | "{{vc}}" 748 | ], 749 | "path": [ 750 | "rest", 751 | "vcenter", 752 | "vm" 753 | ], 754 | "query": [ 755 | { 756 | "key": "filter.names.1", 757 | "value": "MyVM" 758 | } 759 | ] 760 | }, 761 | "description": "Find a VM based on the specified filter, in this case the vm name when it was created." 762 | }, 763 | "response": [] 764 | }, 765 | { 766 | "name": "Create with defaults", 767 | "request": { 768 | "method": "POST", 769 | "header": [ 770 | { 771 | "key": "Content-Type", 772 | "value": "application/json" 773 | } 774 | ], 775 | "body": { 776 | "mode": "raw", 777 | "raw": "{\n \"spec\": {\n \"guest_OS\": \"RHEL_7_64\",\n \"placement\" : {\n \"datastore\": \"datastore-12\",\n \"folder\": \"group-v7\",\n \"resource_pool\": \"resgroup-9\"\n }\n }\n}" 778 | }, 779 | "url": { 780 | "raw": "https://{{vc}}/rest/vcenter/vm", 781 | "protocol": "https", 782 | "host": [ 783 | "{{vc}}" 784 | ], 785 | "path": [ 786 | "rest", 787 | "vcenter", 788 | "vm" 789 | ] 790 | }, 791 | "description": "Create a new VM with the bare minimum properties. All other properties will use sensible defaults." 792 | }, 793 | "response": [] 794 | }, 795 | { 796 | "name": "Delete", 797 | "request": { 798 | "method": "DELETE", 799 | "header": [], 800 | "body": { 801 | "mode": "formdata", 802 | "formdata": [] 803 | }, 804 | "url": { 805 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-32", 806 | "protocol": "https", 807 | "host": [ 808 | "{{vc}}" 809 | ], 810 | "path": [ 811 | "rest", 812 | "vcenter", 813 | "vm", 814 | "vm-32" 815 | ] 816 | }, 817 | "description": "Delete the specified VM" 818 | }, 819 | "response": [] 820 | } 821 | ], 822 | "description": "The requests in this collection can be called independently. Each request may require various bits of data such as the vm id or name, etc." 823 | }, 824 | { 825 | "name": "VM Adapter - SATA", 826 | "item": [ 827 | { 828 | "name": "List", 829 | "request": { 830 | "method": "GET", 831 | "header": [], 832 | "url": { 833 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/adapter/sata", 834 | "protocol": "https", 835 | "host": [ 836 | "{{vc}}" 837 | ], 838 | "path": [ 839 | "rest", 840 | "vcenter", 841 | "vm", 842 | "vm-19", 843 | "hardware", 844 | "adapter", 845 | "sata" 846 | ] 847 | }, 848 | "description": "List SATA IDs for a VM" 849 | }, 850 | "response": [] 851 | }, 852 | { 853 | "name": "Details", 854 | "request": { 855 | "method": "GET", 856 | "header": [], 857 | "url": { 858 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/adapter/sata/15000", 859 | "protocol": "https", 860 | "host": [ 861 | "{{vc}}" 862 | ], 863 | "path": [ 864 | "rest", 865 | "vcenter", 866 | "vm", 867 | "vm-19", 868 | "hardware", 869 | "adapter", 870 | "sata", 871 | "15000" 872 | ] 873 | }, 874 | "description": "Get SATA details for a single VM " 875 | }, 876 | "response": [] 877 | }, 878 | { 879 | "name": "Create", 880 | "request": { 881 | "method": "POST", 882 | "header": [ 883 | { 884 | "key": "Content-Type", 885 | "value": "application/json" 886 | } 887 | ], 888 | "body": { 889 | "mode": "raw", 890 | "raw": "{\r\n \"spec\": {\r\n \"type\": \"AHCI\"\r\n }\r\n}" 891 | }, 892 | "url": { 893 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/adapter/sata", 894 | "protocol": "https", 895 | "host": [ 896 | "{{vc}}" 897 | ], 898 | "path": [ 899 | "rest", 900 | "vcenter", 901 | "vm", 902 | "vm-19", 903 | "hardware", 904 | "adapter", 905 | "sata" 906 | ] 907 | }, 908 | "description": "Create SATA on VM" 909 | }, 910 | "response": [] 911 | }, 912 | { 913 | "name": "Delete", 914 | "request": { 915 | "method": "DELETE", 916 | "header": [], 917 | "body": { 918 | "mode": "raw", 919 | "raw": "" 920 | }, 921 | "url": { 922 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/sata/15001", 923 | "protocol": "https", 924 | "host": [ 925 | "{{vc}}" 926 | ], 927 | "path": [ 928 | "rest", 929 | "vcenter", 930 | "vm", 931 | "vm-33", 932 | "hardware", 933 | "adapter", 934 | "sata", 935 | "15001" 936 | ] 937 | }, 938 | "description": "Delete SATA Device on VM" 939 | }, 940 | "response": [] 941 | } 942 | ] 943 | }, 944 | { 945 | "name": "VM Adapter - SCSI", 946 | "item": [ 947 | { 948 | "name": "List", 949 | "request": { 950 | "method": "GET", 951 | "header": [], 952 | "url": { 953 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/scsi", 954 | "protocol": "https", 955 | "host": [ 956 | "{{vc}}" 957 | ], 958 | "path": [ 959 | "rest", 960 | "vcenter", 961 | "vm", 962 | "vm-33", 963 | "hardware", 964 | "adapter", 965 | "scsi" 966 | ] 967 | }, 968 | "description": "List SCSI IDs for a VM" 969 | }, 970 | "response": [] 971 | }, 972 | { 973 | "name": "Details", 974 | "request": { 975 | "method": "GET", 976 | "header": [], 977 | "url": { 978 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/scsi/1000", 979 | "protocol": "https", 980 | "host": [ 981 | "{{vc}}" 982 | ], 983 | "path": [ 984 | "rest", 985 | "vcenter", 986 | "vm", 987 | "vm-33", 988 | "hardware", 989 | "adapter", 990 | "scsi", 991 | "1000" 992 | ] 993 | }, 994 | "description": "Get SCSI details for a single VM " 995 | }, 996 | "response": [] 997 | }, 998 | { 999 | "name": "Create", 1000 | "request": { 1001 | "method": "POST", 1002 | "header": [ 1003 | { 1004 | "key": "Content-Type", 1005 | "value": "application/json" 1006 | } 1007 | ], 1008 | "body": { 1009 | "mode": "raw", 1010 | "raw": "{\r\n \"spec\": {\r\n \"type\": \"BUSLOGIC\"\r\n }\r\n}" 1011 | }, 1012 | "url": { 1013 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/scsi", 1014 | "protocol": "https", 1015 | "host": [ 1016 | "{{vc}}" 1017 | ], 1018 | "path": [ 1019 | "rest", 1020 | "vcenter", 1021 | "vm", 1022 | "vm-33", 1023 | "hardware", 1024 | "adapter", 1025 | "scsi" 1026 | ] 1027 | }, 1028 | "description": "Create SCSI Device on VM" 1029 | }, 1030 | "response": [] 1031 | }, 1032 | { 1033 | "name": "Update", 1034 | "request": { 1035 | "method": "PATCH", 1036 | "header": [ 1037 | { 1038 | "key": "Content-Type", 1039 | "value": "application/json" 1040 | } 1041 | ], 1042 | "body": { 1043 | "mode": "raw", 1044 | "raw": "{\r\n \"spec\": {\r\n \"sharing\": \"NONE\"\r\n }\r\n}" 1045 | }, 1046 | "url": { 1047 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/scsi/1001", 1048 | "protocol": "https", 1049 | "host": [ 1050 | "{{vc}}" 1051 | ], 1052 | "path": [ 1053 | "rest", 1054 | "vcenter", 1055 | "vm", 1056 | "vm-33", 1057 | "hardware", 1058 | "adapter", 1059 | "scsi", 1060 | "1001" 1061 | ] 1062 | }, 1063 | "description": "Update SCSI Device on VM" 1064 | }, 1065 | "response": [] 1066 | }, 1067 | { 1068 | "name": "Delete", 1069 | "request": { 1070 | "method": "DELETE", 1071 | "header": [], 1072 | "body": { 1073 | "mode": "raw", 1074 | "raw": "" 1075 | }, 1076 | "url": { 1077 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/adapter/scsi/1001", 1078 | "protocol": "https", 1079 | "host": [ 1080 | "{{vc}}" 1081 | ], 1082 | "path": [ 1083 | "rest", 1084 | "vcenter", 1085 | "vm", 1086 | "vm-33", 1087 | "hardware", 1088 | "adapter", 1089 | "scsi", 1090 | "1001" 1091 | ] 1092 | }, 1093 | "description": "Delete SCSI Device on VM" 1094 | }, 1095 | "response": [] 1096 | } 1097 | ] 1098 | }, 1099 | { 1100 | "name": "VM Add", 1101 | "item": [ 1102 | { 1103 | "name": "Login", 1104 | "request": { 1105 | "method": "POST", 1106 | "header": [ 1107 | { 1108 | "key": "Authorization", 1109 | "value": "Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz" 1110 | } 1111 | ], 1112 | "body": { 1113 | "mode": "formdata", 1114 | "formdata": [] 1115 | }, 1116 | "url": { 1117 | "raw": "https://{{vc}}/rest/com/vmware/cis/session", 1118 | "protocol": "https", 1119 | "host": [ 1120 | "{{vc}}" 1121 | ], 1122 | "path": [ 1123 | "rest", 1124 | "com", 1125 | "vmware", 1126 | "cis", 1127 | "session" 1128 | ] 1129 | }, 1130 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables username and password are passed via the " 1131 | }, 1132 | "response": [] 1133 | }, 1134 | { 1135 | "name": "Find a resource pool to use", 1136 | "event": [ 1137 | { 1138 | "listen": "test", 1139 | "script": { 1140 | "type": "text/javascript", 1141 | "exec": [ 1142 | "var resp = JSON.parse(responseBody);", 1143 | "", 1144 | "var resource = (undefined !== resp && undefined !== resp.value && resp.value.length > 0) ? resp.value[0].resource_pool : null;", 1145 | "", 1146 | "console.log(resource);", 1147 | "", 1148 | "if (null !== resource) {", 1149 | " postman.setEnvironmentVariable('Testbed-ResourcePool', resource);", 1150 | "} else {", 1151 | " // break out of execution.. host wasnt found, so we cant create a VM", 1152 | " postman.setNextRequest(null);", 1153 | "}" 1154 | ] 1155 | } 1156 | } 1157 | ], 1158 | "request": { 1159 | "method": "GET", 1160 | "header": [], 1161 | "url": { 1162 | "raw": "https://{{vc}}/rest/vcenter/resource-pool", 1163 | "protocol": "https", 1164 | "host": [ 1165 | "{{vc}}" 1166 | ], 1167 | "path": [ 1168 | "rest", 1169 | "vcenter", 1170 | "resource-pool" 1171 | ] 1172 | }, 1173 | "description": "Grab the first resource pool returned" 1174 | }, 1175 | "response": [] 1176 | }, 1177 | { 1178 | "name": "Find folers to create the VM in", 1179 | "event": [ 1180 | { 1181 | "listen": "test", 1182 | "script": { 1183 | "type": "text/javascript", 1184 | "exec": [ 1185 | "var resp = JSON.parse(responseBody);", 1186 | "", 1187 | "var match = _.find(resp.value, function(item) {", 1188 | " return item.name === \"datastore\";", 1189 | "})", 1190 | "", 1191 | "if (null !== match && undefined !== match) {", 1192 | " postman.setEnvironmentVariable('Testbed-DS', match.folder);", 1193 | "} else {", 1194 | " // break out of execution.. host wasnt found, so we cant create a VM", 1195 | " postman.setNextRequest(null);", 1196 | "}" 1197 | ] 1198 | } 1199 | } 1200 | ], 1201 | "request": { 1202 | "method": "GET", 1203 | "header": [], 1204 | "url": { 1205 | "raw": "https://{{vc}}/rest/vcenter/folder", 1206 | "protocol": "https", 1207 | "host": [ 1208 | "{{vc}}" 1209 | ], 1210 | "path": [ 1211 | "rest", 1212 | "vcenter", 1213 | "folder" 1214 | ] 1215 | }, 1216 | "description": "This request can be called to get a list of folders. To create a VM, we need the datastore and vm folders. If not previously captured during the /datacenter/ details, the response can be parsed for the vm and datastore folders." 1217 | }, 1218 | "response": [] 1219 | }, 1220 | { 1221 | "name": "Create VM", 1222 | "request": { 1223 | "method": "POST", 1224 | "header": [ 1225 | { 1226 | "key": "Content-Type", 1227 | "value": "application/json" 1228 | } 1229 | ], 1230 | "body": { 1231 | "mode": "raw", 1232 | "raw": "{\n \"spec\": {\n \"guest_OS\": \"RHEL_7_64\",\n \"placement\" : {\n \"datastore\": \"{{datastore}}\",\n \"folder\": \"{{Testbed-VM-Folder}}\",\n \"resource_pool\": \"{{Testbed-ResourcePool}}\"\n }\n }\n}" 1233 | }, 1234 | "url": { 1235 | "raw": "https://{{vc}}/rest/vcenter/vm", 1236 | "protocol": "https", 1237 | "host": [ 1238 | "{{vc}}" 1239 | ], 1240 | "path": [ 1241 | "rest", 1242 | "vcenter", 1243 | "vm" 1244 | ] 1245 | }, 1246 | "description": "This request will create a VM using the environment variables for storage, resource pool and folder." 1247 | }, 1248 | "response": [] 1249 | } 1250 | ], 1251 | "description": "This set of requests will show how to add a VM to an existing datacenter created in the setup process." 1252 | }, 1253 | { 1254 | "name": "VM CD-Rom", 1255 | "item": [ 1256 | { 1257 | "name": "CD-Rom: List for a single VM ", 1258 | "request": { 1259 | "method": "GET", 1260 | "header": [], 1261 | "url": { 1262 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/cdrom", 1263 | "protocol": "https", 1264 | "host": [ 1265 | "{{vc}}" 1266 | ], 1267 | "path": [ 1268 | "rest", 1269 | "vcenter", 1270 | "vm", 1271 | "vm-19", 1272 | "hardware", 1273 | "cdrom" 1274 | ] 1275 | }, 1276 | "description": "List CD-Rom IDs for a VM" 1277 | }, 1278 | "response": [] 1279 | }, 1280 | { 1281 | "name": "CD-Rom: Get details for a single VM ", 1282 | "request": { 1283 | "method": "GET", 1284 | "header": [], 1285 | "url": { 1286 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-22/hardware/cdrom/3001", 1287 | "protocol": "https", 1288 | "host": [ 1289 | "{{vc}}" 1290 | ], 1291 | "path": [ 1292 | "rest", 1293 | "vcenter", 1294 | "vm", 1295 | "vm-22", 1296 | "hardware", 1297 | "cdrom", 1298 | "3001" 1299 | ] 1300 | }, 1301 | "description": "Get CD-Rom details for a single VM " 1302 | }, 1303 | "response": [] 1304 | }, 1305 | { 1306 | "name": "CD-Rom: Create IDE", 1307 | "request": { 1308 | "method": "POST", 1309 | "header": [ 1310 | { 1311 | "key": "Content-Type", 1312 | "value": "application/json" 1313 | } 1314 | ], 1315 | "body": { 1316 | "mode": "raw", 1317 | "raw": "{\n \"spec\": {\n \"type\": \"IDE\",\n \"backing\": {\n \"iso_file\": \"[datastore1] photon-minimal-1.0TP2.iso\",\n \"type\": \"ISO_FILE\"\n }\n }\n}" 1318 | }, 1319 | "url": { 1320 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/cdrom", 1321 | "protocol": "https", 1322 | "host": [ 1323 | "{{vc}}" 1324 | ], 1325 | "path": [ 1326 | "rest", 1327 | "vcenter", 1328 | "vm", 1329 | "vm-19", 1330 | "hardware", 1331 | "cdrom" 1332 | ] 1333 | }, 1334 | "description": "Create IDE CD-ROM on VM" 1335 | }, 1336 | "response": [] 1337 | }, 1338 | { 1339 | "name": "CD-Rom: Create SATA", 1340 | "request": { 1341 | "method": "POST", 1342 | "header": [ 1343 | { 1344 | "key": "Content-Type", 1345 | "value": "application/json" 1346 | } 1347 | ], 1348 | "body": { 1349 | "mode": "raw", 1350 | "raw": "{\n \"spec\": {\n \"type\": \"SATA\",\n \"backing\": {\n \"iso_file\": \"[datastore1] photon-minimal-1.0TP2.iso\",\n \"type\": \"ISO_FILE\"\n }\n }\n}" 1351 | }, 1352 | "url": { 1353 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/cdrom", 1354 | "protocol": "https", 1355 | "host": [ 1356 | "{{vc}}" 1357 | ], 1358 | "path": [ 1359 | "rest", 1360 | "vcenter", 1361 | "vm", 1362 | "vm-19", 1363 | "hardware", 1364 | "cdrom" 1365 | ] 1366 | }, 1367 | "description": "Create SATA CD-ROM on VM" 1368 | }, 1369 | "response": [] 1370 | }, 1371 | { 1372 | "name": "CD-Rom: Connect", 1373 | "request": { 1374 | "method": "POST", 1375 | "header": [], 1376 | "body": { 1377 | "mode": "formdata", 1378 | "formdata": [] 1379 | }, 1380 | "url": { 1381 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/cdrom/16000/connect", 1382 | "protocol": "https", 1383 | "host": [ 1384 | "{{vc}}" 1385 | ], 1386 | "path": [ 1387 | "rest", 1388 | "vcenter", 1389 | "vm", 1390 | "vm-33", 1391 | "hardware", 1392 | "cdrom", 1393 | "16000", 1394 | "connect" 1395 | ] 1396 | }, 1397 | "description": "Connect CD-Rom to a VM " 1398 | }, 1399 | "response": [] 1400 | }, 1401 | { 1402 | "name": "CD-Rom: Disconnect", 1403 | "request": { 1404 | "method": "POST", 1405 | "header": [], 1406 | "body": { 1407 | "mode": "formdata", 1408 | "formdata": [] 1409 | }, 1410 | "url": { 1411 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/cdrom/16000/disconnect", 1412 | "protocol": "https", 1413 | "host": [ 1414 | "{{vc}}" 1415 | ], 1416 | "path": [ 1417 | "rest", 1418 | "vcenter", 1419 | "vm", 1420 | "vm-33", 1421 | "hardware", 1422 | "cdrom", 1423 | "16000", 1424 | "disconnect" 1425 | ] 1426 | }, 1427 | "description": "Disconnect CD-Rom from a VM " 1428 | }, 1429 | "response": [] 1430 | }, 1431 | { 1432 | "name": "CD-Rom: Update", 1433 | "request": { 1434 | "method": "PATCH", 1435 | "header": [ 1436 | { 1437 | "key": "Content-Type", 1438 | "value": "application/json" 1439 | } 1440 | ], 1441 | "body": { 1442 | "mode": "raw", 1443 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"iso_file\": \"[datastore1] MyOS.iso\",\n \"type\": \"ISO_FILE\"\n }\n }\n}" 1444 | }, 1445 | "url": { 1446 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/cdrom/3000", 1447 | "protocol": "https", 1448 | "host": [ 1449 | "{{vc}}" 1450 | ], 1451 | "path": [ 1452 | "rest", 1453 | "vcenter", 1454 | "vm", 1455 | "vm-19", 1456 | "hardware", 1457 | "cdrom", 1458 | "3000" 1459 | ] 1460 | }, 1461 | "description": "Update CD-Rom to remove ISO File" 1462 | }, 1463 | "response": [] 1464 | }, 1465 | { 1466 | "name": "CD-Rom: Delete", 1467 | "request": { 1468 | "method": "DELETE", 1469 | "header": [], 1470 | "body": { 1471 | "mode": "raw", 1472 | "raw": "" 1473 | }, 1474 | "url": { 1475 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/cdrom/3000", 1476 | "protocol": "https", 1477 | "host": [ 1478 | "{{vc}}" 1479 | ], 1480 | "path": [ 1481 | "rest", 1482 | "vcenter", 1483 | "vm", 1484 | "vm-33", 1485 | "hardware", 1486 | "cdrom", 1487 | "3000" 1488 | ] 1489 | }, 1490 | "description": "Create IDE CD-ROM on VM" 1491 | }, 1492 | "response": [] 1493 | } 1494 | ] 1495 | }, 1496 | { 1497 | "name": "VM CPU copy", 1498 | "item": [ 1499 | { 1500 | "name": "CPU: Get for a single VM", 1501 | "request": { 1502 | "method": "GET", 1503 | "header": [], 1504 | "url": { 1505 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/cpu", 1506 | "protocol": "https", 1507 | "host": [ 1508 | "{{vc}}" 1509 | ], 1510 | "path": [ 1511 | "rest", 1512 | "vcenter", 1513 | "vm", 1514 | "vm-19", 1515 | "hardware", 1516 | "cpu" 1517 | ] 1518 | }, 1519 | "description": "Return the CPU related settings of a virtual machine." 1520 | }, 1521 | "response": [] 1522 | }, 1523 | { 1524 | "name": "CPU: Update", 1525 | "request": { 1526 | "method": "PATCH", 1527 | "header": [ 1528 | { 1529 | "key": "Content-Type", 1530 | "value": "application/json" 1531 | } 1532 | ], 1533 | "body": { 1534 | "mode": "raw", 1535 | "raw": "{\n \"spec\": {\n \"count\": 2,\n \"hot_remove_enabled\": false,\n \"cores_per_socket\": 1,\n \"hot_add_enabled\": false\n }\n}" 1536 | }, 1537 | "url": { 1538 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/cpu", 1539 | "protocol": "https", 1540 | "host": [ 1541 | "{{vc}}" 1542 | ], 1543 | "path": [ 1544 | "rest", 1545 | "vcenter", 1546 | "vm", 1547 | "vm-33", 1548 | "hardware", 1549 | "cpu" 1550 | ] 1551 | }, 1552 | "description": "Update the CPU related settings of a virtual machine." 1553 | }, 1554 | "response": [] 1555 | } 1556 | ] 1557 | }, 1558 | { 1559 | "name": "VM Disk", 1560 | "item": [ 1561 | { 1562 | "name": "Get", 1563 | "request": { 1564 | "method": "GET", 1565 | "header": [], 1566 | "url": { 1567 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/disk", 1568 | "protocol": "https", 1569 | "host": [ 1570 | "{{vc}}" 1571 | ], 1572 | "path": [ 1573 | "rest", 1574 | "vcenter", 1575 | "vm", 1576 | "vm-19", 1577 | "hardware", 1578 | "disk" 1579 | ] 1580 | }, 1581 | "description": "Return the Disk related settings of a virtual machine." 1582 | }, 1583 | "response": [] 1584 | }, 1585 | { 1586 | "name": "Details", 1587 | "request": { 1588 | "method": "GET", 1589 | "header": [], 1590 | "url": { 1591 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/disk/3000", 1592 | "protocol": "https", 1593 | "host": [ 1594 | "{{vc}}" 1595 | ], 1596 | "path": [ 1597 | "rest", 1598 | "vcenter", 1599 | "vm", 1600 | "vm-19", 1601 | "hardware", 1602 | "disk", 1603 | "3000" 1604 | ] 1605 | }, 1606 | "description": "Get Disk details for a single VM " 1607 | }, 1608 | "response": [] 1609 | }, 1610 | { 1611 | "name": "Create IDE", 1612 | "request": { 1613 | "method": "POST", 1614 | "header": [ 1615 | { 1616 | "key": "Content-Type", 1617 | "value": "application/json" 1618 | } 1619 | ], 1620 | "body": { 1621 | "mode": "raw", 1622 | "raw": "{\r\n \"spec\": {\r\n \"new_vmdk\": {\r\n },\r\n \"type\": \"IDE\"\r\n }\r\n}" 1623 | }, 1624 | "url": { 1625 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/disk", 1626 | "protocol": "https", 1627 | "host": [ 1628 | "{{vc}}" 1629 | ], 1630 | "path": [ 1631 | "rest", 1632 | "vcenter", 1633 | "vm", 1634 | "vm-19", 1635 | "hardware", 1636 | "disk" 1637 | ] 1638 | }, 1639 | "description": "Create IDE Disk with default size." 1640 | }, 1641 | "response": [] 1642 | }, 1643 | { 1644 | "name": "Create SATA", 1645 | "request": { 1646 | "method": "POST", 1647 | "header": [ 1648 | { 1649 | "key": "Content-Type", 1650 | "value": "application/json" 1651 | } 1652 | ], 1653 | "body": { 1654 | "mode": "raw", 1655 | "raw": "{\r\n \"spec\": {\r\n \"new_vmdk\": {\r\n },\r\n \"type\": \"SATA\"\r\n }\r\n}" 1656 | }, 1657 | "url": { 1658 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/disk", 1659 | "protocol": "https", 1660 | "host": [ 1661 | "{{vc}}" 1662 | ], 1663 | "path": [ 1664 | "rest", 1665 | "vcenter", 1666 | "vm", 1667 | "vm-19", 1668 | "hardware", 1669 | "disk" 1670 | ] 1671 | }, 1672 | "description": "Create SATA Disk with default size." 1673 | }, 1674 | "response": [] 1675 | }, 1676 | { 1677 | "name": "Change VMDK location", 1678 | "request": { 1679 | "method": "PATCH", 1680 | "header": [ 1681 | { 1682 | "key": "Content-Type", 1683 | "value": "application/json" 1684 | } 1685 | ], 1686 | "body": { 1687 | "mode": "raw", 1688 | "raw": "{\r\n \"spec\": {\r\n \"backing\": {\r\n \"vmdk_file\": \"[datastore1] vAPIVM/vAPIVM_2.vmdk\",\r\n \"type\": \"VMDK_FILE\"\r\n }\r\n }\r\n}" 1689 | }, 1690 | "url": { 1691 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/disk/3002", 1692 | "protocol": "https", 1693 | "host": [ 1694 | "{{vc}}" 1695 | ], 1696 | "path": [ 1697 | "rest", 1698 | "vcenter", 1699 | "vm", 1700 | "vm-33", 1701 | "hardware", 1702 | "disk", 1703 | "3002" 1704 | ] 1705 | }, 1706 | "description": "Change disk VMDK location to new VMDK" 1707 | }, 1708 | "response": [] 1709 | }, 1710 | { 1711 | "name": "Delete", 1712 | "request": { 1713 | "method": "DELETE", 1714 | "header": [], 1715 | "body": { 1716 | "mode": "formdata", 1717 | "formdata": [] 1718 | }, 1719 | "url": { 1720 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/disk/3002", 1721 | "protocol": "https", 1722 | "host": [ 1723 | "{{vc}}" 1724 | ], 1725 | "path": [ 1726 | "rest", 1727 | "vcenter", 1728 | "vm", 1729 | "vm-19", 1730 | "hardware", 1731 | "disk", 1732 | "3002" 1733 | ] 1734 | }, 1735 | "description": "Delete a given disk from a virtual machine." 1736 | }, 1737 | "response": [] 1738 | } 1739 | ] 1740 | }, 1741 | { 1742 | "name": "VM Ethernet", 1743 | "item": [ 1744 | { 1745 | "name": "Get", 1746 | "request": { 1747 | "method": "GET", 1748 | "header": [], 1749 | "url": { 1750 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-20/hardware/ethernet", 1751 | "protocol": "https", 1752 | "host": [ 1753 | "{{vc}}" 1754 | ], 1755 | "path": [ 1756 | "rest", 1757 | "vcenter", 1758 | "vm", 1759 | "vm-20", 1760 | "hardware", 1761 | "ethernet" 1762 | ] 1763 | }, 1764 | "description": "Return the Ethernet related settings of a virtual machine." 1765 | }, 1766 | "response": [] 1767 | }, 1768 | { 1769 | "name": "Details", 1770 | "request": { 1771 | "method": "GET", 1772 | "header": [], 1773 | "url": { 1774 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-20/hardware/ethernet/4000", 1775 | "protocol": "https", 1776 | "host": [ 1777 | "{{vc}}" 1778 | ], 1779 | "path": [ 1780 | "rest", 1781 | "vcenter", 1782 | "vm", 1783 | "vm-20", 1784 | "hardware", 1785 | "ethernet", 1786 | "4000" 1787 | ] 1788 | }, 1789 | "description": "Get details for a single Adapter" 1790 | }, 1791 | "response": [] 1792 | }, 1793 | { 1794 | "name": "Create E1000", 1795 | "request": { 1796 | "method": "POST", 1797 | "header": [ 1798 | { 1799 | "key": "Content-Type", 1800 | "value": "application/json" 1801 | } 1802 | ], 1803 | "body": { 1804 | "mode": "raw", 1805 | "raw": "{\r\n \"spec\": {\r\n \"type\": \"E1000\",\r\n \"backing\": {\r\n \"type\": \"NETWORK\",\r\n \"network\": \"network-18\"\r\n }\r\n }\r\n}" 1806 | }, 1807 | "url": { 1808 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-20/hardware/ethernet", 1809 | "protocol": "https", 1810 | "host": [ 1811 | "{{vc}}" 1812 | ], 1813 | "path": [ 1814 | "rest", 1815 | "vcenter", 1816 | "vm", 1817 | "vm-20", 1818 | "hardware", 1819 | "ethernet" 1820 | ] 1821 | }, 1822 | "description": "Create E1000 Network Adapter" 1823 | }, 1824 | "response": [] 1825 | }, 1826 | { 1827 | "name": "Connect", 1828 | "request": { 1829 | "method": "POST", 1830 | "header": [], 1831 | "body": { 1832 | "mode": "formdata", 1833 | "formdata": [] 1834 | }, 1835 | "url": { 1836 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/ethernet/4000/connect", 1837 | "protocol": "https", 1838 | "host": [ 1839 | "{{vc}}" 1840 | ], 1841 | "path": [ 1842 | "rest", 1843 | "vcenter", 1844 | "vm", 1845 | "vm-19", 1846 | "hardware", 1847 | "ethernet", 1848 | "4000", 1849 | "connect" 1850 | ] 1851 | }, 1852 | "description": "Connect Ethernet device to the virtual machine." 1853 | }, 1854 | "response": [] 1855 | }, 1856 | { 1857 | "name": "Disconnect", 1858 | "request": { 1859 | "method": "POST", 1860 | "header": [], 1861 | "body": { 1862 | "mode": "formdata", 1863 | "formdata": [] 1864 | }, 1865 | "url": { 1866 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/ethernet/4000/disconnect", 1867 | "protocol": "https", 1868 | "host": [ 1869 | "{{vc}}" 1870 | ], 1871 | "path": [ 1872 | "rest", 1873 | "vcenter", 1874 | "vm", 1875 | "vm-33", 1876 | "hardware", 1877 | "ethernet", 1878 | "4000", 1879 | "disconnect" 1880 | ] 1881 | }, 1882 | "description": "Disconnect Ethernet device to the virtual machine." 1883 | }, 1884 | "response": [] 1885 | }, 1886 | { 1887 | "name": "Change Network", 1888 | "request": { 1889 | "method": "PATCH", 1890 | "header": [ 1891 | { 1892 | "key": "Content-Type", 1893 | "value": "application/json" 1894 | } 1895 | ], 1896 | "body": { 1897 | "mode": "raw", 1898 | "raw": "{\r\n \"spec\": {\r\n \"backing\": {\r\n \"type\": \"NETWORK\",\r\n \"network\": \"network-27\"\r\n }\r\n }\r\n}" 1899 | }, 1900 | "url": { 1901 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-19/hardware/ethernet/4000", 1902 | "protocol": "https", 1903 | "host": [ 1904 | "{{vc}}" 1905 | ], 1906 | "path": [ 1907 | "rest", 1908 | "vcenter", 1909 | "vm", 1910 | "vm-19", 1911 | "hardware", 1912 | "ethernet", 1913 | "4000" 1914 | ] 1915 | }, 1916 | "description": "Change Network the VM is attached to" 1917 | }, 1918 | "response": [] 1919 | }, 1920 | { 1921 | "name": "Delete", 1922 | "request": { 1923 | "method": "DELETE", 1924 | "header": [], 1925 | "body": { 1926 | "mode": "formdata", 1927 | "formdata": [] 1928 | }, 1929 | "url": { 1930 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/ethernet/4000", 1931 | "protocol": "https", 1932 | "host": [ 1933 | "{{vc}}" 1934 | ], 1935 | "path": [ 1936 | "rest", 1937 | "vcenter", 1938 | "vm", 1939 | "vm-33", 1940 | "hardware", 1941 | "ethernet", 1942 | "4000" 1943 | ] 1944 | }, 1945 | "description": "Delete a given ethernet adapter from a virtual machine." 1946 | }, 1947 | "response": [] 1948 | } 1949 | ] 1950 | }, 1951 | { 1952 | "name": "VM Floppy", 1953 | "item": [ 1954 | { 1955 | "name": "List", 1956 | "request": { 1957 | "method": "GET", 1958 | "header": [], 1959 | "url": { 1960 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy", 1961 | "protocol": "https", 1962 | "host": [ 1963 | "{{vc}}" 1964 | ], 1965 | "path": [ 1966 | "rest", 1967 | "vcenter", 1968 | "vm", 1969 | "vm-33", 1970 | "hardware", 1971 | "floppy" 1972 | ] 1973 | }, 1974 | "description": "List Floppy IDs for a VM" 1975 | }, 1976 | "response": [] 1977 | }, 1978 | { 1979 | "name": "Details", 1980 | "request": { 1981 | "method": "GET", 1982 | "header": [], 1983 | "url": { 1984 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy/8000", 1985 | "protocol": "https", 1986 | "host": [ 1987 | "{{vc}}" 1988 | ], 1989 | "path": [ 1990 | "rest", 1991 | "vcenter", 1992 | "vm", 1993 | "vm-33", 1994 | "hardware", 1995 | "floppy", 1996 | "8000" 1997 | ] 1998 | }, 1999 | "description": "Get Floppy details for a single VM " 2000 | }, 2001 | "response": [] 2002 | }, 2003 | { 2004 | "name": "Create", 2005 | "request": { 2006 | "method": "POST", 2007 | "header": [ 2008 | { 2009 | "key": "Content-Type", 2010 | "value": "application/json" 2011 | } 2012 | ], 2013 | "body": { 2014 | "mode": "raw", 2015 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"type\": \"CLIENT_DEVICE\"\n }\n }\n}" 2016 | }, 2017 | "url": { 2018 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy", 2019 | "protocol": "https", 2020 | "host": [ 2021 | "{{vc}}" 2022 | ], 2023 | "path": [ 2024 | "rest", 2025 | "vcenter", 2026 | "vm", 2027 | "vm-33", 2028 | "hardware", 2029 | "floppy" 2030 | ] 2031 | }, 2032 | "description": "Create Floppy on VM" 2033 | }, 2034 | "response": [] 2035 | }, 2036 | { 2037 | "name": "Connect", 2038 | "request": { 2039 | "method": "POST", 2040 | "header": [], 2041 | "body": { 2042 | "mode": "formdata", 2043 | "formdata": [] 2044 | }, 2045 | "url": { 2046 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy/8001/connect", 2047 | "protocol": "https", 2048 | "host": [ 2049 | "{{vc}}" 2050 | ], 2051 | "path": [ 2052 | "rest", 2053 | "vcenter", 2054 | "vm", 2055 | "vm-33", 2056 | "hardware", 2057 | "floppy", 2058 | "8001", 2059 | "connect" 2060 | ] 2061 | }, 2062 | "description": "Connect Floppy to a VM " 2063 | }, 2064 | "response": [] 2065 | }, 2066 | { 2067 | "name": "Disconnect", 2068 | "request": { 2069 | "method": "POST", 2070 | "header": [], 2071 | "body": { 2072 | "mode": "formdata", 2073 | "formdata": [] 2074 | }, 2075 | "url": { 2076 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy/8001/disconnect", 2077 | "protocol": "https", 2078 | "host": [ 2079 | "{{vc}}" 2080 | ], 2081 | "path": [ 2082 | "rest", 2083 | "vcenter", 2084 | "vm", 2085 | "vm-33", 2086 | "hardware", 2087 | "floppy", 2088 | "8001", 2089 | "disconnect" 2090 | ] 2091 | }, 2092 | "description": "Disconnect Floppy from a VM " 2093 | }, 2094 | "response": [] 2095 | }, 2096 | { 2097 | "name": "Update", 2098 | "request": { 2099 | "method": "PATCH", 2100 | "header": [ 2101 | { 2102 | "key": "Content-Type", 2103 | "value": "application/json" 2104 | } 2105 | ], 2106 | "body": { 2107 | "mode": "raw", 2108 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"type\": \"IMAGE_FILE\",\n \"image_file\": \"[datastore1] test.flp\"\n }\n }\n}" 2109 | }, 2110 | "url": { 2111 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy/8001", 2112 | "protocol": "https", 2113 | "host": [ 2114 | "{{vc}}" 2115 | ], 2116 | "path": [ 2117 | "rest", 2118 | "vcenter", 2119 | "vm", 2120 | "vm-33", 2121 | "hardware", 2122 | "floppy", 2123 | "8001" 2124 | ] 2125 | }, 2126 | "description": "Update FLoppy to use flp file" 2127 | }, 2128 | "response": [] 2129 | }, 2130 | { 2131 | "name": "Delete", 2132 | "request": { 2133 | "method": "DELETE", 2134 | "header": [], 2135 | "body": { 2136 | "mode": "raw", 2137 | "raw": "" 2138 | }, 2139 | "url": { 2140 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/floppy/8001", 2141 | "protocol": "https", 2142 | "host": [ 2143 | "{{vc}}" 2144 | ], 2145 | "path": [ 2146 | "rest", 2147 | "vcenter", 2148 | "vm", 2149 | "vm-33", 2150 | "hardware", 2151 | "floppy", 2152 | "8001" 2153 | ] 2154 | }, 2155 | "description": "Delete Floppy on VM" 2156 | }, 2157 | "response": [] 2158 | } 2159 | ] 2160 | }, 2161 | { 2162 | "name": "VM Memory", 2163 | "item": [ 2164 | { 2165 | "name": "Get", 2166 | "request": { 2167 | "method": "GET", 2168 | "header": [], 2169 | "url": { 2170 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/memory", 2171 | "protocol": "https", 2172 | "host": [ 2173 | "{{vc}}" 2174 | ], 2175 | "path": [ 2176 | "rest", 2177 | "vcenter", 2178 | "vm", 2179 | "vm-33", 2180 | "hardware", 2181 | "memory" 2182 | ] 2183 | }, 2184 | "description": "Return the Memory related settings of a virtual machine." 2185 | }, 2186 | "response": [] 2187 | }, 2188 | { 2189 | "name": "Update", 2190 | "request": { 2191 | "method": "PATCH", 2192 | "header": [ 2193 | { 2194 | "key": "Content-Type", 2195 | "value": "application/json" 2196 | } 2197 | ], 2198 | "body": { 2199 | "mode": "raw", 2200 | "raw": "{\n \"spec\": {\n \"size_MiB\": 512\n }\n}" 2201 | }, 2202 | "url": { 2203 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/memory", 2204 | "protocol": "https", 2205 | "host": [ 2206 | "{{vc}}" 2207 | ], 2208 | "path": [ 2209 | "rest", 2210 | "vcenter", 2211 | "vm", 2212 | "vm-33", 2213 | "hardware", 2214 | "memory" 2215 | ] 2216 | }, 2217 | "description": "Update the Memory related settings of a virtual machine." 2218 | }, 2219 | "response": [] 2220 | } 2221 | ] 2222 | }, 2223 | { 2224 | "name": "VM Parallel", 2225 | "item": [ 2226 | { 2227 | "name": "List", 2228 | "request": { 2229 | "method": "GET", 2230 | "header": [], 2231 | "url": { 2232 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel", 2233 | "protocol": "https", 2234 | "host": [ 2235 | "{{vc}}" 2236 | ], 2237 | "path": [ 2238 | "rest", 2239 | "vcenter", 2240 | "vm", 2241 | "vm-33", 2242 | "hardware", 2243 | "parallel" 2244 | ] 2245 | }, 2246 | "description": "List Parallel IDs for a VM" 2247 | }, 2248 | "response": [] 2249 | }, 2250 | { 2251 | "name": "Details", 2252 | "request": { 2253 | "method": "GET", 2254 | "header": [], 2255 | "url": { 2256 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/10000", 2257 | "protocol": "https", 2258 | "host": [ 2259 | "{{vc}}" 2260 | ], 2261 | "path": [ 2262 | "rest", 2263 | "vcenter", 2264 | "vm", 2265 | "vm-33", 2266 | "hardware", 2267 | "parallel", 2268 | "10000" 2269 | ] 2270 | }, 2271 | "description": "Get Parallel details for a single VM " 2272 | }, 2273 | "response": [] 2274 | }, 2275 | { 2276 | "name": "Create", 2277 | "request": { 2278 | "method": "POST", 2279 | "header": [ 2280 | { 2281 | "key": "Content-Type", 2282 | "value": "application/json" 2283 | } 2284 | ], 2285 | "body": { 2286 | "mode": "raw", 2287 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"file\": \"[datastore1] parallel2\",\n \"type\": \"FILE\"\n }\n }\n}" 2288 | }, 2289 | "url": { 2290 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/", 2291 | "protocol": "https", 2292 | "host": [ 2293 | "{{vc}}" 2294 | ], 2295 | "path": [ 2296 | "rest", 2297 | "vcenter", 2298 | "vm", 2299 | "vm-33", 2300 | "hardware", 2301 | "parallel", 2302 | "" 2303 | ] 2304 | }, 2305 | "description": "Create Parallel device on VM" 2306 | }, 2307 | "response": [] 2308 | }, 2309 | { 2310 | "name": "Connect", 2311 | "request": { 2312 | "method": "POST", 2313 | "header": [], 2314 | "body": { 2315 | "mode": "formdata", 2316 | "formdata": [] 2317 | }, 2318 | "url": { 2319 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/10000/connect", 2320 | "protocol": "https", 2321 | "host": [ 2322 | "{{vc}}" 2323 | ], 2324 | "path": [ 2325 | "rest", 2326 | "vcenter", 2327 | "vm", 2328 | "vm-33", 2329 | "hardware", 2330 | "parallel", 2331 | "10000", 2332 | "connect" 2333 | ] 2334 | }, 2335 | "description": "Connect Parallel device to a VM " 2336 | }, 2337 | "response": [] 2338 | }, 2339 | { 2340 | "name": "Disconnect", 2341 | "request": { 2342 | "method": "POST", 2343 | "header": [], 2344 | "body": { 2345 | "mode": "formdata", 2346 | "formdata": [] 2347 | }, 2348 | "url": { 2349 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/10000/disconnect", 2350 | "protocol": "https", 2351 | "host": [ 2352 | "{{vc}}" 2353 | ], 2354 | "path": [ 2355 | "rest", 2356 | "vcenter", 2357 | "vm", 2358 | "vm-33", 2359 | "hardware", 2360 | "parallel", 2361 | "10000", 2362 | "disconnect" 2363 | ] 2364 | }, 2365 | "description": "Disconnect Parallel device from a VM " 2366 | }, 2367 | "response": [] 2368 | }, 2369 | { 2370 | "name": "Update", 2371 | "request": { 2372 | "method": "PATCH", 2373 | "header": [ 2374 | { 2375 | "key": "Content-Type", 2376 | "value": "application/json" 2377 | } 2378 | ], 2379 | "body": { 2380 | "mode": "raw", 2381 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"file\": \"[datastore1] parallel3\",\n \"type\": \"FILE\"\n }\n }\n}" 2382 | }, 2383 | "url": { 2384 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/10001", 2385 | "protocol": "https", 2386 | "host": [ 2387 | "{{vc}}" 2388 | ], 2389 | "path": [ 2390 | "rest", 2391 | "vcenter", 2392 | "vm", 2393 | "vm-33", 2394 | "hardware", 2395 | "parallel", 2396 | "10001" 2397 | ] 2398 | }, 2399 | "description": "Update Parallel to use new file" 2400 | }, 2401 | "response": [] 2402 | }, 2403 | { 2404 | "name": "Delete", 2405 | "request": { 2406 | "method": "DELETE", 2407 | "header": [], 2408 | "body": { 2409 | "mode": "raw", 2410 | "raw": "" 2411 | }, 2412 | "url": { 2413 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/parallel/10001", 2414 | "protocol": "https", 2415 | "host": [ 2416 | "{{vc}}" 2417 | ], 2418 | "path": [ 2419 | "rest", 2420 | "vcenter", 2421 | "vm", 2422 | "vm-33", 2423 | "hardware", 2424 | "parallel", 2425 | "10001" 2426 | ] 2427 | }, 2428 | "description": "Delete Parallel device on VM" 2429 | }, 2430 | "response": [] 2431 | } 2432 | ] 2433 | }, 2434 | { 2435 | "name": "VM Power", 2436 | "item": [ 2437 | { 2438 | "name": "Power On", 2439 | "request": { 2440 | "method": "POST", 2441 | "header": [], 2442 | "body": { 2443 | "mode": "formdata", 2444 | "formdata": [] 2445 | }, 2446 | "url": { 2447 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/power/start", 2448 | "protocol": "https", 2449 | "host": [ 2450 | "{{vc}}" 2451 | ], 2452 | "path": [ 2453 | "rest", 2454 | "vcenter", 2455 | "vm", 2456 | "vm-33", 2457 | "power", 2458 | "start" 2459 | ] 2460 | }, 2461 | "description": "Power On a VM" 2462 | }, 2463 | "response": [] 2464 | }, 2465 | { 2466 | "name": "Suspend", 2467 | "request": { 2468 | "method": "POST", 2469 | "header": [], 2470 | "body": { 2471 | "mode": "formdata", 2472 | "formdata": [] 2473 | }, 2474 | "url": { 2475 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/power/suspend", 2476 | "protocol": "https", 2477 | "host": [ 2478 | "{{vc}}" 2479 | ], 2480 | "path": [ 2481 | "rest", 2482 | "vcenter", 2483 | "vm", 2484 | "vm-33", 2485 | "power", 2486 | "suspend" 2487 | ] 2488 | }, 2489 | "description": "Suspend a VM" 2490 | }, 2491 | "response": [] 2492 | }, 2493 | { 2494 | "name": "Reset", 2495 | "request": { 2496 | "method": "POST", 2497 | "header": [], 2498 | "body": { 2499 | "mode": "formdata", 2500 | "formdata": [] 2501 | }, 2502 | "url": { 2503 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/power/reset", 2504 | "protocol": "https", 2505 | "host": [ 2506 | "{{vc}}" 2507 | ], 2508 | "path": [ 2509 | "rest", 2510 | "vcenter", 2511 | "vm", 2512 | "vm-33", 2513 | "power", 2514 | "reset" 2515 | ] 2516 | }, 2517 | "description": "Reset a VM" 2518 | }, 2519 | "response": [] 2520 | }, 2521 | { 2522 | "name": "Power Off", 2523 | "request": { 2524 | "method": "POST", 2525 | "header": [], 2526 | "body": { 2527 | "mode": "formdata", 2528 | "formdata": [] 2529 | }, 2530 | "url": { 2531 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/power/stop", 2532 | "protocol": "https", 2533 | "host": [ 2534 | "{{vc}}" 2535 | ], 2536 | "path": [ 2537 | "rest", 2538 | "vcenter", 2539 | "vm", 2540 | "vm-33", 2541 | "power", 2542 | "stop" 2543 | ] 2544 | }, 2545 | "description": "Power Off a VM" 2546 | }, 2547 | "response": [] 2548 | }, 2549 | { 2550 | "name": "Details", 2551 | "request": { 2552 | "method": "GET", 2553 | "header": [], 2554 | "url": { 2555 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/power", 2556 | "protocol": "https", 2557 | "host": [ 2558 | "{{vc}}" 2559 | ], 2560 | "path": [ 2561 | "rest", 2562 | "vcenter", 2563 | "vm", 2564 | "vm-33", 2565 | "power" 2566 | ] 2567 | }, 2568 | "description": "List power details for a VM" 2569 | }, 2570 | "response": [] 2571 | } 2572 | ] 2573 | }, 2574 | { 2575 | "name": "VM Serial", 2576 | "item": [ 2577 | { 2578 | "name": "List", 2579 | "request": { 2580 | "method": "GET", 2581 | "header": [], 2582 | "url": { 2583 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial", 2584 | "protocol": "https", 2585 | "host": [ 2586 | "{{vc}}" 2587 | ], 2588 | "path": [ 2589 | "rest", 2590 | "vcenter", 2591 | "vm", 2592 | "vm-33", 2593 | "hardware", 2594 | "serial" 2595 | ] 2596 | }, 2597 | "description": "List Serial IDs for a VM" 2598 | }, 2599 | "response": [] 2600 | }, 2601 | { 2602 | "name": "Details", 2603 | "request": { 2604 | "method": "GET", 2605 | "header": [], 2606 | "url": { 2607 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/9000", 2608 | "protocol": "https", 2609 | "host": [ 2610 | "{{vc}}" 2611 | ], 2612 | "path": [ 2613 | "rest", 2614 | "vcenter", 2615 | "vm", 2616 | "vm-33", 2617 | "hardware", 2618 | "serial", 2619 | "9000" 2620 | ] 2621 | }, 2622 | "description": "Get Serial details for a single VM " 2623 | }, 2624 | "response": [] 2625 | }, 2626 | { 2627 | "name": "Create", 2628 | "request": { 2629 | "method": "POST", 2630 | "header": [ 2631 | { 2632 | "key": "Content-Type", 2633 | "value": "application/json" 2634 | } 2635 | ], 2636 | "body": { 2637 | "mode": "raw", 2638 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"file\": \"[datastore1] serial2\",\n \"type\": \"FILE\"\n }\n }\n}" 2639 | }, 2640 | "url": { 2641 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/", 2642 | "protocol": "https", 2643 | "host": [ 2644 | "{{vc}}" 2645 | ], 2646 | "path": [ 2647 | "rest", 2648 | "vcenter", 2649 | "vm", 2650 | "vm-33", 2651 | "hardware", 2652 | "serial", 2653 | "" 2654 | ] 2655 | }, 2656 | "description": "Create Serial device on VM" 2657 | }, 2658 | "response": [] 2659 | }, 2660 | { 2661 | "name": "Connect", 2662 | "request": { 2663 | "method": "POST", 2664 | "header": [], 2665 | "body": { 2666 | "mode": "formdata", 2667 | "formdata": [] 2668 | }, 2669 | "url": { 2670 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/9000/connect", 2671 | "protocol": "https", 2672 | "host": [ 2673 | "{{vc}}" 2674 | ], 2675 | "path": [ 2676 | "rest", 2677 | "vcenter", 2678 | "vm", 2679 | "vm-33", 2680 | "hardware", 2681 | "serial", 2682 | "9000", 2683 | "connect" 2684 | ] 2685 | }, 2686 | "description": "Connect Serial device to a VM " 2687 | }, 2688 | "response": [] 2689 | }, 2690 | { 2691 | "name": "Disconnect", 2692 | "request": { 2693 | "method": "POST", 2694 | "header": [], 2695 | "body": { 2696 | "mode": "formdata", 2697 | "formdata": [] 2698 | }, 2699 | "url": { 2700 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/9000/disconnect", 2701 | "protocol": "https", 2702 | "host": [ 2703 | "{{vc}}" 2704 | ], 2705 | "path": [ 2706 | "rest", 2707 | "vcenter", 2708 | "vm", 2709 | "vm-33", 2710 | "hardware", 2711 | "serial", 2712 | "9000", 2713 | "disconnect" 2714 | ] 2715 | }, 2716 | "description": "Disconnect Serial device from a VM " 2717 | }, 2718 | "response": [] 2719 | }, 2720 | { 2721 | "name": "Update", 2722 | "request": { 2723 | "method": "PATCH", 2724 | "header": [ 2725 | { 2726 | "key": "Content-Type", 2727 | "value": "application/json" 2728 | } 2729 | ], 2730 | "body": { 2731 | "mode": "raw", 2732 | "raw": "{\n \"spec\": {\n \"backing\": {\n \"file\": \"[datastore1] Serial3\",\n \"type\": \"FILE\"\n }\n }\n}" 2733 | }, 2734 | "url": { 2735 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/9000", 2736 | "protocol": "https", 2737 | "host": [ 2738 | "{{vc}}" 2739 | ], 2740 | "path": [ 2741 | "rest", 2742 | "vcenter", 2743 | "vm", 2744 | "vm-33", 2745 | "hardware", 2746 | "serial", 2747 | "9000" 2748 | ] 2749 | }, 2750 | "description": "Update Serial to use new file" 2751 | }, 2752 | "response": [] 2753 | }, 2754 | { 2755 | "name": "Delete", 2756 | "request": { 2757 | "method": "DELETE", 2758 | "header": [], 2759 | "body": { 2760 | "mode": "raw", 2761 | "raw": "" 2762 | }, 2763 | "url": { 2764 | "raw": "https://{{vc}}/rest/vcenter/vm/vm-33/hardware/serial/9000", 2765 | "protocol": "https", 2766 | "host": [ 2767 | "{{vc}}" 2768 | ], 2769 | "path": [ 2770 | "rest", 2771 | "vcenter", 2772 | "vm", 2773 | "vm-33", 2774 | "hardware", 2775 | "serial", 2776 | "9000" 2777 | ] 2778 | }, 2779 | "description": "Delete Serial device on VM" 2780 | }, 2781 | "response": [] 2782 | } 2783 | ] 2784 | } 2785 | ] 2786 | } 2787 | -------------------------------------------------------------------------------- /samples/postman/vSphere-Automation-REST-resources-for-Content-Library.postman_collection.json: -------------------------------------------------------------------------------- 1 | { 2 | "variables": [], 3 | "info": { 4 | "name": "vSphere Automation REST resources for Content Library", 5 | "_postman_id": "80de2712-f5f9-b1bd-9f46-ca90301a67b4", 6 | "description": "vSphere Automation REST resources for Content Library", 7 | "schema": "https://schema.getpostman.com/json/collection/v2.0.0/collection.json" 8 | }, 9 | "item": [ 10 | { 11 | "name": "- Session", 12 | "description": "", 13 | "item": [ 14 | { 15 | "name": "Login to vCenter", 16 | "event": [ 17 | { 18 | "listen": "test", 19 | "script": { 20 | "type": "text/javascript", 21 | "exec": [ 22 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 23 | ] 24 | } 25 | } 26 | ], 27 | "request": { 28 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 29 | "method": "POST", 30 | "header": [ 31 | { 32 | "key": "Authorization", 33 | "value": "Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz", 34 | "description": "" 35 | } 36 | ], 37 | "body": {}, 38 | "description": "Login to vCenter API and retrieve Session" 39 | }, 40 | "response": [] 41 | }, 42 | { 43 | "name": "Get current session info", 44 | "event": [ 45 | { 46 | "listen": "test", 47 | "script": { 48 | "type": "text/javascript", 49 | "exec": [ 50 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 51 | ] 52 | } 53 | } 54 | ], 55 | "request": { 56 | "url": "https://{{vc}}/rest/com/vmware/cis/session?~action=get", 57 | "method": "POST", 58 | "header": [], 59 | "body": {}, 60 | "description": "Get current session info" 61 | }, 62 | "response": [] 63 | }, 64 | { 65 | "name": "Logout of vCenter ", 66 | "event": [ 67 | { 68 | "listen": "test", 69 | "script": { 70 | "type": "text/javascript", 71 | "exec": [ 72 | "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;" 73 | ] 74 | } 75 | } 76 | ], 77 | "request": { 78 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 79 | "method": "DELETE", 80 | "header": [], 81 | "body": {}, 82 | "description": "Logout of vCenter API" 83 | }, 84 | "response": [] 85 | } 86 | ] 87 | }, 88 | { 89 | "name": "All Librarys", 90 | "description": "", 91 | "item": [ 92 | { 93 | "name": "Content Library: List", 94 | "request": { 95 | "url": "https://{{vc}}/rest/com/vmware/content/library", 96 | "method": "GET", 97 | "header": [], 98 | "body": {}, 99 | "description": "List Content Library IDs" 100 | }, 101 | "response": [] 102 | }, 103 | { 104 | "name": "Content Library: Get details of single library", 105 | "request": { 106 | "url": "https://{{vc}}/rest/com/vmware/content/library/id:7ea9915d-6542-4dff-8ff0-f0bf9f315f77", 107 | "method": "GET", 108 | "header": [], 109 | "body": {}, 110 | "description": "List Content Library IDs" 111 | }, 112 | "response": [] 113 | } 114 | ] 115 | }, 116 | { 117 | "name": "Library Items", 118 | "description": "", 119 | "item": [ 120 | { 121 | "name": "List all items in a specific library", 122 | "request": { 123 | "url": "https://{{vc}}/rest/com/vmware/content/library/item?library_id=0527489b-d316-442e-8784-2e8e0234b35c", 124 | "method": "GET", 125 | "header": [], 126 | "body": {}, 127 | "description": "List Content Library IDs" 128 | }, 129 | "response": [] 130 | }, 131 | { 132 | "name": "List details of a library item", 133 | "request": { 134 | "url": "https://{{vc}}/rest/com/vmware/content/library/item/id:67ecae42-f7a1-4720-99f6-c0b01f769ec3", 135 | "method": "GET", 136 | "header": [], 137 | "body": {}, 138 | "description": "List Content Library IDs" 139 | }, 140 | "response": [] 141 | }, 142 | { 143 | "name": "List files in a specific library item", 144 | "request": { 145 | "url": "https://{{vc}}/rest/com/vmware/content/library/item/file?library_item_id=67ecae42-f7a1-4720-99f6-c0b01f769ec3", 146 | "method": "GET", 147 | "header": [], 148 | "body": {}, 149 | "description": "List Content Library IDs" 150 | }, 151 | "response": [] 152 | }, 153 | { 154 | "name": "List storage items in a specific library item", 155 | "request": { 156 | "url": "https://{{vc}}/rest/com/vmware/content/library/item/storage?library_item_id=67ecae42-f7a1-4720-99f6-c0b01f769ec3", 157 | "method": "GET", 158 | "header": [], 159 | "body": {}, 160 | "description": "List Content Library IDs" 161 | }, 162 | "response": [] 163 | }, 164 | { 165 | "name": "Query an OVF package for deployment details", 166 | "request": { 167 | "url": "https://{{vc}}/rest/com/vmware/vcenter/ovf/library-item/id:34d670b1-42d4-4e7b-9884-315dd50d6660?~action=filter", 168 | "method": "POST", 169 | "header": [ 170 | { 171 | "key": "Content-Type", 172 | "value": "application/json", 173 | "description": "" 174 | } 175 | ], 176 | "body": { 177 | "mode": "raw", 178 | "raw": "{\r\n \"target\": {\r\n \"folder_id\": \"group-v9\",\r\n \"host_id\": \"host-10\",\r\n \"resource_pool_id\": \"resgroup-8\"\r\n }\r\n}" 179 | }, 180 | "description": "" 181 | }, 182 | "response": [] 183 | }, 184 | { 185 | "name": "Deploy a library item", 186 | "request": { 187 | "url": "https://{{vc}}/rest/com/vmware/vcenter/ovf/library-item/id:6cbbef21-a5a3-4929-aecf-619da80881df?~action=deploy", 188 | "method": "POST", 189 | "header": [ 190 | { 191 | "key": "Content-Type", 192 | "value": "application/json", 193 | "description": "" 194 | } 195 | ], 196 | "body": { 197 | "mode": "raw", 198 | "raw": "{\r\n \"deployment_spec\": {\r\n \"accept_all_EULA\": true,\r\n \"default_datastore_id\": \"datastore-14\"\r\n },\r\n \"target\": {\r\n \"folder_id\": \"group-v7\",\r\n \"host_id\": \"host-10\",\r\n \"resource_pool_id\": \"resgroup-9\"\r\n }\r\n}" 199 | }, 200 | "description": "" 201 | }, 202 | "response": [] 203 | } 204 | ] 205 | }, 206 | { 207 | "name": "Local Library", 208 | "description": "", 209 | "item": [ 210 | { 211 | "name": "Content Library: Create", 212 | "request": { 213 | "url": "https://{{vc}}/rest/com/vmware/content/local-library", 214 | "method": "POST", 215 | "header": [ 216 | { 217 | "key": "Content-Type", 218 | "value": "application/json", 219 | "description": "" 220 | } 221 | ], 222 | "body": { 223 | "mode": "raw", 224 | "raw": "{\r\n \"create_spec\": {\r\n \"name\": \"CL1\",\r\n \"description\": \"CL1 Desc\",\r\n \"publish_info\": {\r\n \"authentication_method\": \"NONE\",\r\n \"persist_json_enabled\": false,\r\n \"published\": false\r\n },\r\n \"storage_backings\": [\r\n {\r\n \"datastore_id\": \"datastore-12\",\r\n \"type\": \"DATASTORE\"\r\n }\r\n ],\r\n \"type\": \"LOCAL\"\r\n }\r\n}" 225 | }, 226 | "description": "Create Local Content Library" 227 | }, 228 | "response": [] 229 | }, 230 | { 231 | "name": "List all local librarys", 232 | "request": { 233 | "url": "https://{{vc}}/rest/com/vmware/content/local-library", 234 | "method": "GET", 235 | "header": [], 236 | "body": {}, 237 | "description": "List Content Library IDs" 238 | }, 239 | "response": [] 240 | }, 241 | { 242 | "name": "Get details of a local library", 243 | "request": { 244 | "url": "https://{{vc}}/rest/com/vmware/content/local-library/id:618f1654-b48c-4886-a266-ad17e30d63fa", 245 | "method": "GET", 246 | "header": [], 247 | "body": {}, 248 | "description": "" 249 | }, 250 | "response": [] 251 | }, 252 | { 253 | "name": "Delete a local library", 254 | "request": { 255 | "url": "https://{{vc}}/rest/com/vmware/content/local-library/id:618f1654-b48c-4886-a266-ad17e30d63fa", 256 | "method": "DELETE", 257 | "header": [], 258 | "body": {}, 259 | "description": "" 260 | }, 261 | "response": [] 262 | } 263 | ] 264 | }, 265 | { 266 | "name": "Subscribed Library", 267 | "description": "", 268 | "item": [ 269 | { 270 | "name": "Subscribed Library: Create", 271 | "request": { 272 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library", 273 | "method": "POST", 274 | "header": [ 275 | { 276 | "key": "Content-Type", 277 | "value": "application/json", 278 | "description": "" 279 | } 280 | ], 281 | "body": { 282 | "mode": "raw", 283 | "raw": "{\r\n \"create_spec\": {\r\n \"subscription_info\": {\r\n \"authentication_method\": \"NONE\",\r\n \"ssl_thumbprint\": \"69:d9:9e:e9:0b:4b:68:24:09:2b:ce:14:d7:4a:f9:8c:bd:c6:5a:e9\",\r\n \"automatic_sync_enabled\": true,\r\n \"subscription_url\": \"https://s3-us-west-1.amazonaws.com/vghetto-content-library/lib.json\",\r\n \"on_demand\": false\r\n },\r\n \"name\": \"virtuallyGhetto CL\",\r\n \"description\": \"William Lams CL: http://www.virtuallyghetto.com/2015/04/subscribe-to-vghetto-nested-esxi-template-content-library-in-vsphere-6-0.html\",\r\n \"publish_info\": {\r\n \"authentication_method\": \"NONE\",\r\n \"persist_json_enabled\": false,\r\n \"published\": false\r\n },\r\n \"storage_backings\": [\r\n {\r\n \"datastore_id\": \"datastore-28\",\r\n \"type\": \"DATASTORE\"\r\n }\r\n ],\r\n \"type\": \"SUBSCRIBED\"\r\n }\r\n}" 284 | }, 285 | "description": "Subscribe to online Library" 286 | }, 287 | "response": [] 288 | }, 289 | { 290 | "name": "List all subscribed librarys", 291 | "request": { 292 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library", 293 | "method": "GET", 294 | "header": [], 295 | "body": {}, 296 | "description": "List Content Library IDs" 297 | }, 298 | "response": [] 299 | }, 300 | { 301 | "name": "Get details of a subscribed library", 302 | "request": { 303 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library/id:c063ff5c-4b65-4330-a5ca-ff191a4037c4", 304 | "method": "GET", 305 | "header": [], 306 | "body": {}, 307 | "description": "" 308 | }, 309 | "response": [] 310 | }, 311 | { 312 | "name": "Delete a subscribed library", 313 | "request": { 314 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library/id:c063ff5c-4b65-4330-a5ca-ff191a4037c4", 315 | "method": "DELETE", 316 | "header": [], 317 | "body": {}, 318 | "description": "" 319 | }, 320 | "response": [] 321 | }, 322 | { 323 | "name": "Evict cached content of on-demand subscribed library", 324 | "request": { 325 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library/id:559b4db5-3953-4a42-8997-a118e4dc5f49?~action=evict", 326 | "method": "POST", 327 | "header": [], 328 | "body": {}, 329 | "description": "" 330 | }, 331 | "response": [] 332 | }, 333 | { 334 | "name": "Force sync of subscribed library", 335 | "request": { 336 | "url": "https://{{vc}}/rest/com/vmware/content/subscribed-library/id:559b4db5-3953-4a42-8997-a118e4dc5f49?~action=sync", 337 | "method": "POST", 338 | "header": [], 339 | "body": {}, 340 | "description": "" 341 | }, 342 | "response": [] 343 | } 344 | ] 345 | } 346 | ] 347 | } -------------------------------------------------------------------------------- /samples/postman/vSphere-Automation-Rest-API-Samples.postman.json: -------------------------------------------------------------------------------- 1 | { 2 | "id": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 3 | "name": "vSphere Automation REST Samples", 4 | "description": "These samples will show how to use the SHIM API. Each folder will provide a description of what APIs it will show how to use. Along the way, some environment variables will be set as part of some response processing done using Javascript. As well, some environment varialbes will be required, such as the host ip, username and password, etc. Many of the samples will reuse previously set environment variables, so if a request within a sample doesnt work, check the description of the request or the request url, headers and body for any {{ }} tokens and make sure they are available in the selected environment. Below are the environment variables needed to be preset for the samples to work.\n\n* vc - the IP or URL of the host VC\n* user - the user name to log in with\n* password - the password to log in with\n* host1 - a unique ip address to a host\n* host2 - another unique ip address to a host\n", 5 | "order": [], 6 | "folders": [ 7 | { 8 | "id": "fb1ca52e-d2d9-1caf-6734-983cee2c88c9", 9 | "name": "Host Connect", 10 | "description": "This set of requests will attempt to connect a host if it is disconnected. It will find the host if it is in a disconnected state, then proceed to connect it.", 11 | "order": [ 12 | "b569db37-6d8a-099b-a0bd-c1da13e4194d", 13 | "e3a94207-87a4-32a2-32ed-bdc4303ac921", 14 | "36665eee-ed3b-2b77-7866-abc9e77dd4f8", 15 | "9428a397-bda4-8179-ec2a-19aac4059f35" 16 | ], 17 | "owner": "287921", 18 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 19 | }, 20 | { 21 | "id": "986bd781-095c-68d2-78cf-9fc8792c44dd", 22 | "name": "Host Disconnect", 23 | "description": "This set of requests will attempt to disconnect a host if it is connected. It will find the host if it is in a connected state, then proceed to disconnect it.", 24 | "order": [ 25 | "264c4f9a-5ab5-8dac-00dc-ad821a18f60c", 26 | "08551637-97ed-1bf2-57c8-6fa0cee6e989", 27 | "07c98e9e-7e08-7eac-9894-2a714c881e1d", 28 | "2f90dda2-94b1-8707-17ea-67b241107167" 29 | ], 30 | "owner": "287921", 31 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 32 | }, 33 | { 34 | "id": "afebfe49-69c3-09bf-872b-d928645f5690", 35 | "name": "Host add", 36 | "description": "This set of requests will add a host to a datacenter", 37 | "order": [ 38 | "3414f518-eea3-5f77-d0c9-c6a1989efe89", 39 | "17b5eb69-e3a3-a2cd-40b6-befe96f1f619", 40 | "8acdc166-2403-807f-fa7a-1fc5c98fbe2f", 41 | "435c4ae3-5212-4456-f788-9f3c17e1f47d", 42 | "c52d2133-6c29-b8c0-0041-14c2f76e6af9" 43 | ], 44 | "owner": "287921", 45 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 46 | }, 47 | { 48 | "id": "44cdd8b0-4e8d-8a33-6986-219962c69e52", 49 | "name": "Host remove", 50 | "description": "This set of requests will show how to remove a host from a datacenter. It will use the {{host1}} pre configured environment variable, removing it from the datacenter if it exists. ", 51 | "order": [ 52 | "ddd1adfe-742a-95ea-8681-3aac62e94642", 53 | "723de728-629d-8d0e-8b25-0eb4afa03acb", 54 | "5d3489bd-f6da-d390-8bc9-4092d1315ad1", 55 | "2edaddb0-6e83-8b47-60e9-806fa45ba46f" 56 | ], 57 | "owner": "287921", 58 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 59 | }, 60 | { 61 | "id": "69cac46c-0b82-b3e6-33fe-fca2e7e9a19e", 62 | "name": "VM Create with Defaults", 63 | "description": "This sample will show the API resource calls (with details) to make in order to create a VM as simply as possible. It will use the VM sensible defaults for all other details not provided. Their are only 3 environment variables needed. The datastore, the vm folder, and the resource pool", 64 | "order": [ 65 | "1ce5305c-f77b-0627-92d8-2a81b1d46cc9", 66 | "9c1798a7-6cb3-d0e9-9805-e99f0624bbbe", 67 | "366396dd-4fec-08e9-a01b-300d5fa270d4", 68 | "6691f2eb-bf31-cfe2-53b5-aef7cf2969c0", 69 | "d722001b-a8ca-c2d3-9719-f857a8f34ebc", 70 | "97ff3948-76c1-dcb0-144b-76f10723c3c3", 71 | "d92af6a5-54a4-7a53-58f3-cc116dc68738" 72 | ], 73 | "owner": "287921", 74 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 75 | }, 76 | { 77 | "id": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3", 78 | "name": "VM Create with details", 79 | "description": "This collection of requests will show how to gather data that is then applied to the VM create resource for more specific VM creation. Storage, resource poolls, hosts, and more will be retrieved.", 80 | "order": [ 81 | "bbdd4a74-e987-567d-97f5-6111851cf4bc", 82 | "f7eedd33-421f-202d-3387-16dc08b54210", 83 | "a4d38843-0c22-a819-1414-46d73fe8f92d", 84 | "23b35fef-9c84-731c-4917-d18dacb1d3b4", 85 | "3c7b9f1d-5d19-0284-4655-773756fb22a6", 86 | "965b9c65-fac3-3cd0-465d-bab1b169247a", 87 | "474184b7-243c-1e4b-9032-a9d145791eb6" 88 | ], 89 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 90 | }, 91 | { 92 | "id": "ab4a0b5a-abcc-9cc7-f6c5-11c75166e2b8", 93 | "name": "VM Power On/Off", 94 | "description": "This set of requests will show how to turn a VM on and off.", 95 | "order": [ 96 | "e9fa0fcf-a551-3327-d23d-1248c4c7fc89", 97 | "8d395360-3a1a-2a1c-d004-854d8e502b0c", 98 | "4619131b-aae3-84cb-c03d-6cbee2875dec", 99 | "21ba90f9-6a45-af88-b9ac-0032f491bc5b", 100 | "2c3afcd6-341e-de73-15c0-15b34ae618cc" 101 | ], 102 | "owner": "287921", 103 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 104 | } 105 | ], 106 | "timestamp": 1458664643676, 107 | "owner": "287921", 108 | "remoteLink": "", 109 | "public": false, 110 | "requests": [ 111 | { 112 | "id": "07c98e9e-7e08-7eac-9894-2a714c881e1d", 113 | "headers": "", 114 | "url": "https://{{vc}}/rest/vcenter/host/{{Host-1-Name}}/disconnect", 115 | "preRequestScript": "", 116 | "pathVariables": {}, 117 | "method": "POST", 118 | "data": [], 119 | "dataMode": "raw", 120 | "tests": "", 121 | "currentHelper": "normal", 122 | "helperAttributes": {}, 123 | "time": 1460564894321, 124 | "name": "Disconnect", 125 | "description": "Disconnect a connected host", 126 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 127 | "rawModeData": "" 128 | }, 129 | { 130 | "id": "08551637-97ed-1bf2-57c8-6fa0cee6e989", 131 | "headers": "", 132 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}&filter.connection_states.1=CONNECTED", 133 | "preRequestScript": "", 134 | "pathVariables": {}, 135 | "method": "GET", 136 | "data": [], 137 | "dataMode": "params", 138 | "tests": "var jsonData = JSON.parse(responseBody);\nvar host = jsonData.value; \nif (host !== null && host.length > 0) {\n // set the host name environment variable for the next request to use\n postman.setEnvironmentVariable('Host-1-Name', host[0].host);\n postman.setNextRequest('Disconnect');\n} else {\n // Host must already be connected, or possibly not responding\n postman.setNextRequest(null);\n}\n", 139 | "currentHelper": "normal", 140 | "helperAttributes": {}, 141 | "time": 1460564847139, 142 | "name": "Find connected host", 143 | "description": "This request will look for the {{host1}} using the host api filter to also only find it if its connect_state property is set to DISCONNECTED. If found, it will set the environment variable Host-1-Name to the name of the host, and the next request to the Connect request. If the host is already connected or possibly in a not responding state, the next request is set to null to end the flow.", 144 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 145 | }, 146 | { 147 | "id": "17b5eb69-e3a3-a2cd-40b6-befe96f1f619", 148 | "headers": "", 149 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}", 150 | "preRequestScript": "", 151 | "pathVariables": {}, 152 | "method": "GET", 153 | "data": [], 154 | "dataMode": "params", 155 | "tests": "var jsonData = JSON.parse(responseBody);\nvar host = jsonData.value; \nif (host !== null && host.length <= 0) {\n // no host found, lets add it... set next request in chain to find the host folder, which is\n // needed to add the host to the datacenter\n postman.setNextRequest('Find Host Folder');\n} else {\n // host is already added, dont proceed\n console.log('already added');\n postman.setNextRequest(null);\n}\n", 156 | "currentHelper": "normal", 157 | "helperAttributes": {}, 158 | "time": 1460562136949, 159 | "name": "Check if host exists", 160 | "description": "First we will get the list of hosts and filter on the {{host1}}", 161 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 162 | }, 163 | { 164 | "id": "1ce5305c-f77b-0627-92d8-2a81b1d46cc9", 165 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 166 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 167 | "preRequestScript": "", 168 | "pathVariables": {}, 169 | "method": "POST", 170 | "data": [], 171 | "dataMode": "params", 172 | "version": 2, 173 | "tests": "", 174 | "currentHelper": "normal", 175 | "helperAttributes": {}, 176 | "time": 1460565813849, 177 | "name": "Login", 178 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 179 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 180 | "responses": [], 181 | "folder": "69cac46c-0b82-b3e6-33fe-fca2e7e9a19e" 182 | }, 183 | { 184 | "id": "21ba90f9-6a45-af88-b9ac-0032f491bc5b", 185 | "headers": "", 186 | "url": "https://{{vc}}/rest/vcenter/vm/{{vm}}/power/stop", 187 | "preRequestScript": "", 188 | "pathVariables": {}, 189 | "method": "POST", 190 | "data": [], 191 | "dataMode": "params", 192 | "tests": "", 193 | "currentHelper": "normal", 194 | "helperAttributes": {}, 195 | "time": 1460568782876, 196 | "name": "Power off", 197 | "description": "This request will turn the {{vm}} off", 198 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 199 | }, 200 | { 201 | "id": "23b35fef-9c84-731c-4917-d18dacb1d3b4", 202 | "headers": "", 203 | "url": "https://{{vc}}/rest/vcenter/resource-pool?filter.names.1=Resources&filter.hosts.1={{host-id}}", 204 | "preRequestScript": "", 205 | "pathVariables": {}, 206 | "method": "GET", 207 | "data": [], 208 | "dataMode": "params", 209 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('resource-pool', jsonData.value[0].resource_pool);\n}", 210 | "currentHelper": "normal", 211 | "helperAttributes": {}, 212 | "time": 1461346436879, 213 | "name": "Find ResourcePool for host1", 214 | "description": "This call will return a list of resource pools", 215 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 216 | "folder": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3" 217 | }, 218 | { 219 | "id": "264c4f9a-5ab5-8dac-00dc-ad821a18f60c", 220 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 221 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 222 | "pathVariables": {}, 223 | "preRequestScript": "", 224 | "method": "POST", 225 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 226 | "data": [], 227 | "dataMode": "params", 228 | "name": "Login", 229 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 230 | "descriptionFormat": "html", 231 | "time": 1458080930525, 232 | "version": 2, 233 | "responses": [], 234 | "tests": "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;", 235 | "currentHelper": "normal", 236 | "helperAttributes": {}, 237 | "folder": "986bd781-095c-68d2-78cf-9fc8792c44dd" 238 | }, 239 | { 240 | "id": "2c3afcd6-341e-de73-15c0-15b34ae618cc", 241 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 242 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 243 | "preRequestScript": "", 244 | "pathVariables": {}, 245 | "method": "DELETE", 246 | "data": [], 247 | "dataMode": "params", 248 | "version": 2, 249 | "tests": "", 250 | "currentHelper": "normal", 251 | "helperAttributes": {}, 252 | "time": 1466028737319, 253 | "name": "Logout", 254 | "description": "Logout", 255 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 256 | "responses": [], 257 | "folder": "ab4a0b5a-abcc-9cc7-f6c5-11c75166e2b8" 258 | }, 259 | { 260 | "id": "2edaddb0-6e83-8b47-60e9-806fa45ba46f", 261 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 262 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 263 | "preRequestScript": "", 264 | "pathVariables": {}, 265 | "method": "DELETE", 266 | "data": [], 267 | "dataMode": "params", 268 | "version": 2, 269 | "tests": "", 270 | "currentHelper": "normal", 271 | "helperAttributes": {}, 272 | "time": 1466028742436, 273 | "name": "Logout", 274 | "description": "Logout", 275 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 276 | "responses": [], 277 | "folder": "44cdd8b0-4e8d-8a33-6986-219962c69e52" 278 | }, 279 | { 280 | "id": "2f90dda2-94b1-8707-17ea-67b241107167", 281 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 282 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 283 | "preRequestScript": "", 284 | "pathVariables": {}, 285 | "method": "DELETE", 286 | "data": [], 287 | "dataMode": "params", 288 | "version": 2, 289 | "tests": "", 290 | "currentHelper": "normal", 291 | "helperAttributes": {}, 292 | "time": 1466028742436, 293 | "name": "Logout", 294 | "description": "Logout", 295 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 296 | "responses": [], 297 | "folder": "986bd781-095c-68d2-78cf-9fc8792c44dd" 298 | }, 299 | { 300 | "id": "3414f518-eea3-5f77-d0c9-c6a1989efe89", 301 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 302 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 303 | "pathVariables": {}, 304 | "preRequestScript": "", 305 | "method": "POST", 306 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 307 | "data": [], 308 | "dataMode": "params", 309 | "name": "Login", 310 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 311 | "descriptionFormat": "html", 312 | "time": 1458080930525, 313 | "version": 2, 314 | "responses": [], 315 | "tests": "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;", 316 | "currentHelper": "normal", 317 | "helperAttributes": {}, 318 | "folder": "afebfe49-69c3-09bf-872b-d928645f5690" 319 | }, 320 | { 321 | "id": "366396dd-4fec-08e9-a01b-300d5fa270d4", 322 | "headers": "", 323 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}", 324 | "preRequestScript": "", 325 | "pathVariables": {}, 326 | "method": "GET", 327 | "data": [], 328 | "dataMode": "params", 329 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n postman.setEnvironmentVariable('host-id', jsonData.value[0].host);\n}", 330 | "currentHelper": "normal", 331 | "helperAttributes": {}, 332 | "time": 1461346389079, 333 | "name": "Find Host1", 334 | "description": "This request will use the /host resource to find {{host1}}.", 335 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 336 | }, 337 | { 338 | "id": "36665eee-ed3b-2b77-7866-abc9e77dd4f8", 339 | "headers": "", 340 | "url": "https://{{vc}}/rest/vcenter/host/{{Host-1-Name}}/connect", 341 | "preRequestScript": "", 342 | "pathVariables": {}, 343 | "method": "POST", 344 | "data": [], 345 | "dataMode": "raw", 346 | "tests": "", 347 | "currentHelper": "normal", 348 | "helperAttributes": {}, 349 | "time": 1460564722508, 350 | "name": "Connect", 351 | "description": "Connect a disconnected host", 352 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 353 | "rawModeData": "" 354 | }, 355 | { 356 | "id": "3c7b9f1d-5d19-0284-4655-773756fb22a6", 357 | "headers": "Content-Type: application/json\n", 358 | "url": "https://{{vc}}/rest/vcenter/folder?filter.type=VIRTUAL_MACHINE&filter.names.1=Discovered virtual machine", 359 | "preRequestScript": "", 360 | "pathVariables": {}, 361 | "method": "GET", 362 | "data": [], 363 | "dataMode": "params", 364 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('vm-folder', jsonData.value[0].folder);\n}", 365 | "currentHelper": "normal", 366 | "helperAttributes": {}, 367 | "time": 1461345844291, 368 | "name": "Find VM Folder", 369 | "description": "This request uses the /folders resource to find the folder by the name of 'vm'. If found, it sets an environment variable {vm-folder} to the folder value of the response.", 370 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 371 | "folder": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3" 372 | }, 373 | { 374 | "id": "435c4ae3-5212-4456-f788-9f3c17e1f47d", 375 | "headers": "Content-Type: application/json\n", 376 | "url": "https://{{vc}}/rest/vcenter/host", 377 | "preRequestScript": "", 378 | "pathVariables": {}, 379 | "method": "POST", 380 | "data": [], 381 | "dataMode": "raw", 382 | "tests": "var jsonData = JSON.parse(responseBody);\nvar host = jsonData.value;\npostman.setEnvironmentVariable(\"Host-1-Name\", host);", 383 | "currentHelper": "normal", 384 | "helperAttributes": {}, 385 | "time": 1459372647178, 386 | "name": "Add host to datacenter", 387 | "description": "This request will use the previously set {{Testbed-Host-Folder}} environment variable from the Find Host Folder request, as well as the {{host1}} environment variable to add {{host1}} to the datacenteer.", 388 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 389 | "folder": "afebfe49-69c3-09bf-872b-d928645f5690", 390 | "rawModeData": "{\n \"spec\": {\n \"force_add\": true,\n \"folder\": \"{{Testbed-Host-Folder}}\",\n \"hostname\": \"{{host1}}\",\n \"user_name\": \"root\",\n \"password\": \"\",\n \"port\": 443,\n \"thumbprint_verification\": \"NONE\"\n }\n}" 391 | }, 392 | { 393 | "id": "4619131b-aae3-84cb-c03d-6cbee2875dec", 394 | "headers": "", 395 | "url": "https://{{vc}}/rest/vcenter/vm/{{vm}}/power/start", 396 | "preRequestScript": "", 397 | "pathVariables": {}, 398 | "method": "POST", 399 | "data": [], 400 | "dataMode": "params", 401 | "tests": "", 402 | "currentHelper": "normal", 403 | "helperAttributes": {}, 404 | "time": 1460568749103, 405 | "name": "Power on", 406 | "description": "This request will turn the VM on", 407 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 408 | }, 409 | { 410 | "id": "474184b7-243c-1e4b-9032-a9d145791eb6", 411 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 412 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 413 | "preRequestScript": "", 414 | "pathVariables": {}, 415 | "method": "DELETE", 416 | "data": [], 417 | "dataMode": "params", 418 | "version": 2, 419 | "tests": "", 420 | "currentHelper": "normal", 421 | "helperAttributes": {}, 422 | "time": 1466028737319, 423 | "name": "Logout", 424 | "description": "Logout", 425 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 426 | "responses": [] 427 | }, 428 | { 429 | "id": "5d3489bd-f6da-d390-8bc9-4092d1315ad1", 430 | "headers": "Content-Type: application/json\n", 431 | "url": "https://{{vc}}/rest/vcenter/host/{{Host-1-Name}}", 432 | "preRequestScript": "", 433 | "pathVariables": {}, 434 | "method": "DELETE", 435 | "data": [], 436 | "dataMode": "raw", 437 | "tests": "", 438 | "currentHelper": "normal", 439 | "helperAttributes": {}, 440 | "time": 1459372582131, 441 | "name": "Remove Host", 442 | "description": "This request will attempt to remove {{host1}}. If the host exists, it should be removed. If not, the request will fail.", 443 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 444 | "folder": "44cdd8b0-4e8d-8a33-6986-219962c69e52", 445 | "rawModeData": "" 446 | }, 447 | { 448 | "id": "6691f2eb-bf31-cfe2-53b5-aef7cf2969c0", 449 | "headers": "", 450 | "url": "https://{{vc}}/rest/vcenter/resource-pool?filter.names.1=Resources&filter.hosts.1={{host-id}}", 451 | "preRequestScript": "", 452 | "pathVariables": {}, 453 | "method": "GET", 454 | "data": [], 455 | "dataMode": "params", 456 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('resource-pool', jsonData.value[0].resource_pool);\n}", 457 | "currentHelper": "normal", 458 | "helperAttributes": {}, 459 | "time": 1461346436879, 460 | "name": "Find ResourcePool for host1", 461 | "description": "This call will return a list of resource pools", 462 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 463 | }, 464 | { 465 | "id": "723de728-629d-8d0e-8b25-0eb4afa03acb", 466 | "headers": "", 467 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}", 468 | "preRequestScript": "", 469 | "pathVariables": {}, 470 | "method": "GET", 471 | "data": [], 472 | "dataMode": "params", 473 | "tests": "var jsonData = JSON.parse(responseBody);\nvar host = jsonData.value; \nif (host !== null && host.length == 1) {\n postman.setEnvironmentVariable('Host-1-Name', host[0].host);\n postman.setNextRequest('Remove Host');\n} else {\n // doesnt exist, dont continue\n postman.setNextRequest(null);\n}\n", 474 | "currentHelper": "normal", 475 | "helperAttributes": {}, 476 | "time": 1460563440829, 477 | "name": "Check if host exists", 478 | "description": "First we will get the list of hosts and filter on the {{host1}}. If the {{host1}} is found, the environment variable ", 479 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 480 | }, 481 | { 482 | "id": "8acdc166-2403-807f-fa7a-1fc5c98fbe2f", 483 | "headers": "", 484 | "url": "https://{{vc}}/rest/vcenter/datacenter/{datacenter}", 485 | "preRequestScript": "", 486 | "pathVariables": {}, 487 | "method": "GET", 488 | "data": [], 489 | "dataMode": "params", 490 | "tests": "var jsonData = JSON.parse(responseBody);\n\nconsole.log(jsonData);\nvar value = jsonData.value;\n\npostman.setEnvironmentVariable(\"Testbed-Host-Folder\", value.host_folder);", 491 | "currentHelper": "normal", 492 | "helperAttributes": {}, 493 | "time": 1463675721841, 494 | "name": "Find Host Folder", 495 | "description": "This call will list the folders and look for the host folder name, assigning it to an environment variable for the next call to use.", 496 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 497 | }, 498 | { 499 | "id": "8d395360-3a1a-2a1c-d004-854d8e502b0c", 500 | "headers": "", 501 | "url": "https://{{vc}}/rest/vcenter/vm?filter.names.1=SampleVM", 502 | "preRequestScript": "", 503 | "pathVariables": {}, 504 | "method": "GET", 505 | "data": [], 506 | "dataMode": "params", 507 | "tests": "var jsonData = JSON.parse(responseBody);\nvar vm = jsonData.value; \nif (vm !== null && vm.length == 1) {\n // Found the VM by name, lets figure out its current state, and set the next request to be\n // called. Also set the {{vm}} environment variable to the vm value.\n postman.setEnvironmentVariable('vm', vm[0].vm);\n \n if (vm[0].power_state === 'POWERED_ON') {\n postman.setNextRequest('Power off');\n } else {\n postman.setNextRequest('Power on');\n }\n} else {\n // could not find VM\n postman.setNextRequest(null);\n}\n", 508 | "currentHelper": "normal", 509 | "helperAttributes": {}, 510 | "time": 1464045281550, 511 | "name": "Find by name", 512 | "description": "Find a VM by using the name the VM was created with", 513 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 514 | }, 515 | { 516 | "id": "9428a397-bda4-8179-ec2a-19aac4059f35", 517 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 518 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 519 | "preRequestScript": "", 520 | "pathVariables": {}, 521 | "method": "DELETE", 522 | "data": [], 523 | "dataMode": "params", 524 | "version": 2, 525 | "tests": "", 526 | "currentHelper": "normal", 527 | "helperAttributes": {}, 528 | "time": 1466028742436, 529 | "name": "Logout", 530 | "description": "Logout", 531 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 532 | "responses": [], 533 | "folder": "fb1ca52e-d2d9-1caf-6734-983cee2c88c9" 534 | }, 535 | { 536 | "id": "965b9c65-fac3-3cd0-465d-bab1b169247a", 537 | "headers": "Content-Type: application/json\n", 538 | "url": "https://{{vc}}/rest/vcenter/vm", 539 | "preRequestScript": "", 540 | "pathVariables": {}, 541 | "method": "POST", 542 | "data": [], 543 | "dataMode": "raw", 544 | "tests": "", 545 | "currentHelper": "normal", 546 | "helperAttributes": {}, 547 | "time": 1464044966450, 548 | "name": "Create detailed VM", 549 | "description": "Create a VM with specific properties defined.", 550 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 551 | "rawModeData": "{\n \"spec\": {\n \"name\": \"SampleVM\",\n \"guest_OS\": \"RHEL_7_64\",\n \"placement\" : {\n \"datastore\": \"{{datastore}}\",\n \"folder\": \"{{vm-folder}}\",\n \"resource_pool\": \"{{resource-pool}}\"\n },\n \"memory\": {\n \"size_MiB\": 4,\n \"hot_add_enabled\": true\n },\n \"floppies\": [],\n \"cpu\": {\n \"hot_remove_enabled\": true,\n \"count\": 1,\n \"hot_add_enabled\": true,\n \"cores_per_socket\": 1\n },\n \"cdroms\": [\n {\n \"type\": \"IDE\",\n \"backing\": {\n \"iso_file\": \"[datastore1] photon-minimal-1.0TP2.iso\",\n \"type\": \"ISO_FILE\"\n }\n }\n ],\n \"disks\": [\n {\n \"new_vmdk\": {\n \"capacity\": 1024\n }\n }\n ]\n }\n}" 552 | }, 553 | { 554 | "id": "97ff3948-76c1-dcb0-144b-76f10723c3c3", 555 | "headers": "Content-Type: application/json\n", 556 | "url": "https://{{vc}}/rest/vcenter/vm", 557 | "preRequestScript": "", 558 | "pathVariables": {}, 559 | "method": "POST", 560 | "data": [], 561 | "dataMode": "raw", 562 | "tests": "", 563 | "currentHelper": "normal", 564 | "helperAttributes": {}, 565 | "time": 1461080916551, 566 | "name": "Create with defaults", 567 | "description": "Create a new VM with the bare minimum properties. All other properties will use sensible defaults. The 3 properties that MUST be defined in environment variables before this call will work are {{datastore}}, {{vm-folder}} and {{resource-pool}}.", 568 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 569 | "rawModeData": "{\n \"spec\": {\n \"guest_OS\": \"RHEL_7_64\",\n \"placement\" : {\n \"datastore\": \"{{datastore}}\",\n \"folder\": \"{{vm-folder}}\",\n \"resource_pool\": \"{{resource-pool}}\"\n }\n }\n}" 570 | }, 571 | { 572 | "id": "9c1798a7-6cb3-d0e9-9805-e99f0624bbbe", 573 | "headers": "Content-Type: application/json\n", 574 | "url": "https://{{vc}}/rest/vcenter/datastore?filter.names.1=datastore1", 575 | "preRequestScript": "", 576 | "pathVariables": {}, 577 | "method": "GET", 578 | "data": [], 579 | "dataMode": "raw", 580 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('datastore', jsonData.value[0].datastore);\n}", 581 | "currentHelper": "normal", 582 | "helperAttributes": {}, 583 | "time": 1461342792630, 584 | "name": "Find Datastore", 585 | "description": "This request will use a filter to match the name of the datastores to 'datastore1'. If found, an environment variable {datastore} is set to the datastore value of the response.", 586 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 587 | "responses": [], 588 | "rawModeData": "{\r\n \"spec\": {\r\n \"name\": \"datastore1\"\r\n }\r\n}" 589 | }, 590 | { 591 | "id": "a4d38843-0c22-a819-1414-46d73fe8f92d", 592 | "headers": "", 593 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}", 594 | "preRequestScript": "", 595 | "pathVariables": {}, 596 | "method": "GET", 597 | "data": [], 598 | "dataMode": "params", 599 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n postman.setEnvironmentVariable('host-id', jsonData.value[0].host);\n}", 600 | "currentHelper": "normal", 601 | "helperAttributes": {}, 602 | "time": 1461346389079, 603 | "name": "Find Host1", 604 | "description": "This request will use the /host resource to find {{host1}}.", 605 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 606 | "folder": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3" 607 | }, 608 | { 609 | "id": "b569db37-6d8a-099b-a0bd-c1da13e4194d", 610 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 611 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 612 | "pathVariables": {}, 613 | "preRequestScript": "", 614 | "method": "POST", 615 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 616 | "data": [], 617 | "dataMode": "params", 618 | "name": "Login", 619 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 620 | "descriptionFormat": "html", 621 | "time": 1458080930525, 622 | "version": 2, 623 | "responses": [], 624 | "tests": "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;", 625 | "currentHelper": "normal", 626 | "helperAttributes": {}, 627 | "folder": "fb1ca52e-d2d9-1caf-6734-983cee2c88c9" 628 | }, 629 | { 630 | "id": "bbdd4a74-e987-567d-97f5-6111851cf4bc", 631 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 632 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 633 | "preRequestScript": "", 634 | "pathVariables": {}, 635 | "method": "POST", 636 | "data": [], 637 | "dataMode": "params", 638 | "version": 2, 639 | "tests": "", 640 | "currentHelper": "normal", 641 | "helperAttributes": {}, 642 | "time": 1460565813849, 643 | "name": "Login", 644 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 645 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 646 | "responses": [], 647 | "folder": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3" 648 | }, 649 | { 650 | "id": "c52d2133-6c29-b8c0-0041-14c2f76e6af9", 651 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 652 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 653 | "preRequestScript": "", 654 | "pathVariables": {}, 655 | "method": "DELETE", 656 | "data": [], 657 | "dataMode": "params", 658 | "version": 2, 659 | "tests": "", 660 | "currentHelper": "normal", 661 | "helperAttributes": {}, 662 | "time": 1466028742436, 663 | "name": "Logout", 664 | "description": "Logout", 665 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 666 | "responses": [], 667 | "folder": "afebfe49-69c3-09bf-872b-d928645f5690" 668 | }, 669 | { 670 | "id": "d722001b-a8ca-c2d3-9719-f857a8f34ebc", 671 | "headers": "Content-Type: application/json\n", 672 | "url": "https://{{vc}}/rest/vcenter/folder?filter.type=VIRTUAL_MACHINE&filter.names.1=Discovered virtual machine", 673 | "preRequestScript": "", 674 | "pathVariables": {}, 675 | "method": "GET", 676 | "data": [], 677 | "dataMode": "params", 678 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('vm-folder', jsonData.value[0].folder);\n}", 679 | "currentHelper": "normal", 680 | "helperAttributes": {}, 681 | "time": 1461345844291, 682 | "name": "Find VM Folder", 683 | "description": "This request uses the /folders resource to find the folder by the name of 'vm'. If found, it sets an environment variable {vm-folder} to the folder value of the response.", 684 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 685 | }, 686 | { 687 | "id": "d92af6a5-54a4-7a53-58f3-cc116dc68738", 688 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 689 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 690 | "preRequestScript": "", 691 | "pathVariables": {}, 692 | "method": "DELETE", 693 | "data": [], 694 | "dataMode": "params", 695 | "version": 2, 696 | "tests": "", 697 | "currentHelper": "normal", 698 | "helperAttributes": {}, 699 | "time": 1466028742436, 700 | "name": "Logout", 701 | "description": "Logout", 702 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 703 | "responses": [] 704 | }, 705 | { 706 | "id": "ddd1adfe-742a-95ea-8681-3aac62e94642", 707 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 708 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 709 | "pathVariables": {}, 710 | "preRequestScript": "", 711 | "method": "POST", 712 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 713 | "data": [], 714 | "dataMode": "params", 715 | "name": "Login", 716 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 717 | "descriptionFormat": "html", 718 | "time": 1458080930525, 719 | "version": 2, 720 | "responses": [], 721 | "tests": "tests[\"Response time is less than 1000ms\"] = responseTime < 1000;", 722 | "currentHelper": "normal", 723 | "helperAttributes": {}, 724 | "folder": "44cdd8b0-4e8d-8a33-6986-219962c69e52" 725 | }, 726 | { 727 | "id": "e3a94207-87a4-32a2-32ed-bdc4303ac921", 728 | "headers": "Accept: application/json\n", 729 | "url": "https://{{vc}}/rest/vcenter/host?filter.names.1={{host1}}&filter.connection_states.1=DISCONNECTED", 730 | "preRequestScript": "", 731 | "pathVariables": {}, 732 | "method": "GET", 733 | "data": [], 734 | "dataMode": "params", 735 | "tests": "var jsonData = JSON.parse(responseBody);\nvar host = jsonData.value; \nif (host !== null && host.length > 0) {\n // set the host name environment variable for the next request to use\n postman.setEnvironmentVariable('Host-1-Name', host[0].host);\n postman.setNextRequest('Connect');\n} else {\n // Host must already be connected, or possibly not responding\n postman.setNextRequest(null);\n}\n", 736 | "currentHelper": "normal", 737 | "helperAttributes": {}, 738 | "time": 1463604490036, 739 | "name": "Find disconnected host", 740 | "description": "This request will look for the {{host1}} using the host api filter to also only find it if its connect_state property is set to DISCONNECTED. If found, it will set the environment variable Host-1-Name to the name of the host, and the next request to the Connect request. If the host is already connected or possibly in a not responding state, the next request is set to null to end the flow.", 741 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133" 742 | }, 743 | { 744 | "id": "e9fa0fcf-a551-3327-d23d-1248c4c7fc89", 745 | "headers": "Authorization: Basic YWRtaW5pc3RyYXRvckB2c3BoZXJlLmxvY2FsOkFkbWluITIz\n", 746 | "url": "https://{{vc}}/rest/com/vmware/cis/session", 747 | "preRequestScript": "", 748 | "pathVariables": {}, 749 | "method": "POST", 750 | "data": [], 751 | "dataMode": "params", 752 | "version": 2, 753 | "tests": "", 754 | "currentHelper": "normal", 755 | "helperAttributes": {}, 756 | "time": 1460565813849, 757 | "name": "Login", 758 | "description": "Login to vCenter API and retrieve Session using username and password. The environment variables user and password are passed via the Authorization header using Basic Auth. The result is the session value, which is the same value stored in the cookie. Postman automatically manages the cookie and sends it on subsequent requests but it is also possible to add a header to send the cookie using the value returned from this call.", 759 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 760 | "responses": [], 761 | "folder": "ab4a0b5a-abcc-9cc7-f6c5-11c75166e2b8" 762 | }, 763 | { 764 | "id": "f7eedd33-421f-202d-3387-16dc08b54210", 765 | "headers": "Content-Type: application/json\n", 766 | "url": "https://{{vc}}/rest/vcenter/datastore?filter.names.1=datastore1", 767 | "preRequestScript": "", 768 | "pathVariables": {}, 769 | "method": "GET", 770 | "data": [], 771 | "dataMode": "raw", 772 | "tests": "var jsonData = JSON.parse(responseBody);\n\nif (undefined !== jsonData && null !== jsonData) {\n console.log(jsonData.value);\n postman.setEnvironmentVariable('datastore', jsonData.value[0].datastore);\n}", 773 | "currentHelper": "normal", 774 | "helperAttributes": {}, 775 | "time": 1461342792630, 776 | "name": "Find Datastore", 777 | "description": "This request will use a filter to match the name of the datastores to 'datastore1'. If found, an environment variable {datastore} is set to the datastore value of the response.", 778 | "collectionId": "5c5259d6-375a-7d63-01c4-7cb7a11e9133", 779 | "responses": [], 780 | "folder": "196f7fbc-51c7-b0a6-61d3-eb4383b3c9a3", 781 | "rawModeData": "{\r\n \"spec\": {\r\n \"name\": \"datastore1\"\r\n }\r\n}" 782 | } 783 | ] 784 | } --------------------------------------------------------------------------------