https://github.com/sky-uk/govrealize
A Go library for interacting with vRealize Automation 6.2 REST API
https://github.com/sky-uk/govrealize
Last synced: 10 months ago
JSON representation
A Go library for interacting with vRealize Automation 6.2 REST API
- Host: GitHub
- URL: https://github.com/sky-uk/govrealize
- Owner: sky-uk
- License: bsd-3-clause
- Created: 2016-12-28T10:54:58.000Z (over 9 years ago)
- Default Branch: master
- Last Pushed: 2017-12-04T14:36:18.000Z (over 8 years ago)
- Last Synced: 2024-06-20T05:23:22.483Z (almost 2 years ago)
- Language: Go
- Size: 17.6 KB
- Stars: 6
- Watchers: 7
- Forks: 3
- Open Issues: 1
-
Metadata Files:
- Readme: README.md
- Contributing: CONTRIBUTING.md
- License: LICENSE.md
Awesome Lists containing this project
README
# govrealize
A Go library for interacting with vRealize Automation 6.2 REST API
## Introduction
govrealize is a Golang client library for interacting with the vRealize REST API detailed here: https://developercenter.vmware.com/web/sdk/6.2.0/vrealize-automation. Currently only the creation, reading and deletion of machines is implemented.
## Usage
Create a vRealize client
```golang
client := m.(*govrealize.Client)
```
Create a machine
```golang
entries := []govrealize.MachineRequestDataEntry{}
mrde := govrealize.MachineRequestDataEntry{
Key: key,
Value: govrealize.MachineRequestDataEntryValue{
Type: "string",
Value: "value",
},
}
entries = append(entries, mrde)
opts := &govrealize.MachineCreateRequest{
Type: "CatalogItemRequest",
CatalogItemRef: govrealize.MachineCreateRequestCatalogItemRef{
ID: "xxxx-xxxxx-xxxxx-xxxx",
},
Organization: govrealize.MachineCreateRequestOrganization{
TenantRef: "tenant",
SubtenantRef: "subtenant",
},
State: "SUBMITTED",
RequestNumber: 0,
RequestData: govrealize.MachineCreateRequestRequestData{
Entries: entries,
},
}
machine, resp, err := client.Machine.CreateMachine(opts)
```
Get a machine
```golang
machine, resp, err := client.Machine.GetMachine("xxxx-xxxx-xxxx-xxxx")
```
Destroy a machine
```golang
destroyed, resp, err := client.Machine.DestroyMachine("xxxx-xxxx-xxxx-xxxx")
```