Skip to content

Commit c2e48f9

Browse files
committed
Get VMware assets API script
Updated get_vmware_assets go script readme file (formatting changes).
1 parent 4bcb9cc commit c2e48f9

1 file changed

Lines changed: 10 additions & 6 deletions

File tree

recipes/go/assets/README.md

Lines changed: 10 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
1-
### NetBackup API Code Samples in go (golang)
1+
### NetBackup API Code Samples in go
22

3-
This directory contains code samples for NetBackup Asset Service APIs.
3+
This directory contains code samples in golang for NetBackup Asset Service APIs.
44

55
#### Disclaimer
66

@@ -16,8 +16,12 @@ The scripts are provided only for reference and not meant for production use.
1616
- get_vmware_assets:
1717
`go run ./get_vmware_assets.go -nbserver <NetBackup server> -username <username> -password <password> [-domainName <domainName>] [-domainType <domainType>] [-assetsFilter <filter>]`
1818

19-
The script invokes the NetBackup VMware Asset Service API to get the VMware workload assets (filtered by the given filter if specified). It prints the details (delimited by tab) such as asset display name, instance Id, vCenter and the protection plan names that the asset is protected by.
20-
_Note: assetsFilter option can be used to filter the assets returned. It should be in OData format (refer to the NetBackup API documentation for more details). It is optional, if not specified the script will print all the VM assets. Redirect the script output to a file to avoid printing the details on terminal._
19+
The script invokes the NetBackup VMware Asset Service API to get the VMware workload assets (filtered by the given filter criteria if specified). It prints the asset details (delimited by tab) such as asset display name, instance Id, vCenter and the protection plan names that the asset is protected by.
2120

22-
Examples: `go run ./get_vmware_assets.go -nbserver localhost -username user -password password -domainName domain -domainType NT > vm_assets.txt`
23-
`go run ./get_vmware_assets.go -nbserver localhost -username user -password password -assetsFilter "contains(commonAssetAttributes/displayName, 'backup')" > vm_assets.txt`
21+
Note: The _assetsFilter_ option can be used to filter the assets returned. It should be in OData format (refer to the NetBackup API documentation for more details). It is optional; if not specified the script will return all VM assets. Redirect the script output to a file to avoid printing the details on terminal.
22+
23+
Examples:
24+
25+
- List all VMs: `go run ./get_vmware_assets.go -nbserver localhost -username user -password password -domainName domain -domainType NT > vm_assets.txt`
26+
27+
- List VMs with filter condition: `go run ./get_vmware_assets.go -nbserver localhost -username user -password password -domainName domain -domainType NT -assetsFilter "contains(commonAssetAttributes/displayName, 'backup')"`

0 commit comments

Comments
 (0)