Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Provider VDC CRUD #580

Merged
merged 59 commits into from
Jul 12, 2023
Merged

Provider VDC CRUD #580

merged 59 commits into from
Jul 12, 2023

Conversation

dataclouder
Copy link
Collaborator

@dataclouder dataclouder commented Jun 19, 2023

  • Add methods to retrieve vSphere vCenters
  • Add methods to retrieve vSphere resource pools
  • Add methods to retrieve network pools
  • Fix some non-cumulative queries to get all paginated elements
  • Add functions to create, update, and delete a Provider VDC

Testing:
go test -tags 'providervdc vsphere' -check.vv -timeout 0

go test -tags 'providervdc vsphere' -vcd-verbose -check.f TestVCD.Test_ProviderVdcCRUD -check.vv -timeout 0
START: api_vcd_test.go:518: TestVCD.SetUpSuite
Running on VCD https://xxxxxxxx.com/api (version 10.4.0.20079017 built at 2022-07-08 22:20:22 +0000 UTC)
as user administrator@System (using password)
Skipping all vapp tests because one of the following wasn't given: Network, StorageProfile, Catalog, Catalogitem
PASS: api_vcd_test.go:518: TestVCD.SetUpSuite	8.243s

START: provider_vdc_test.go:186: TestVCD.Test_ProviderVdcCRUD
*** ProviderVDC with network pool
  creating provider VDC 'TestVCD.Test_ProviderVdcCRUD' using resource pool 'resource-pool-for-vcd-01' and storage profile '*'
  renaming provider VDC to 'TestNewName'
  renaming back provider VDC to 'TestVCD.Test_ProviderVdcCRUD'
  adding resource pool 'resource-pool-for-vcd-02' to provider VDC
  removing resource pool 'resource-pool-for-vcd-02' from provider VDC
  adding storage profile 'Development2' to provider VDC
  removing storage profile 'Development2' from provider VDC
  disabling provider VDC 'TestVCD.Test_ProviderVdcCRUD'
  removing provider VDC 'TestVCD.Test_ProviderVdcCRUD'
*** ProviderVDC without network pool
  creating provider VDC 'TestVCD.Test_ProviderVdcCRUD' using resource pool 'resource-pool-for-vcd-01' and storage profile '*'
  renaming provider VDC to 'TestNewName'
  renaming back provider VDC to 'TestVCD.Test_ProviderVdcCRUD'
  adding resource pool 'resource-pool-for-vcd-02' to provider VDC
  removing resource pool 'resource-pool-for-vcd-02' from provider VDC
  adding storage profile 'Development2' to provider VDC
  removing storage profile 'Development2' from provider VDC
  disabling provider VDC 'TestVCD.Test_ProviderVdcCRUD'
  removing provider VDC 'TestVCD.Test_ProviderVdcCRUD'
*** ProviderVDC with automatic network pool
  creating provider VDC 'TestVCD.Test_ProviderVdcCRUD' using resource pool 'resource-pool-for-vcd-01' and storage profile '*'
  renaming provider VDC to 'TestNewName'
  renaming back provider VDC to 'TestVCD.Test_ProviderVdcCRUD'
  adding resource pool 'resource-pool-for-vcd-02' to provider VDC
  removing resource pool 'resource-pool-for-vcd-02' from provider VDC
  adding storage profile 'Development2' to provider VDC
  removing storage profile 'Development2' from provider VDC
  disabling provider VDC 'TestVCD.Test_ProviderVdcCRUD'
  removing provider VDC 'TestVCD.Test_ProviderVdcCRUD'
PASS: provider_vdc_test.go:186: TestVCD.Test_ProviderVdcCRUD	153.484s

Note: you need to have at least one free resource pool to test provider VDC creation, and at least two of them to test update.

Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
@dataclouder dataclouder marked this pull request as ready for review July 3, 2023 15:38
@dataclouder dataclouder changed the title Provider vdc creation Provider vdc CRUD Jul 3, 2023
@dataclouder dataclouder changed the title Provider vdc CRUD Provider VDC CRUD Jul 3, 2023
@dataclouder dataclouder self-assigned this Jul 3, 2023
Copy link
Collaborator

@lvirbalas lvirbalas left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What a beefy PR, thanks! Just a couple inline comments.

types/v56/types.go Outdated Show resolved Hide resolved
govcd/provider_vdc_test.go Show resolved Hide resolved
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

First pass - mainly with a few questions around ExecuteJsonRequest

types/v56/types.go Show resolved Hide resolved
govcd/network_pool.go Show resolved Hide resolved
govcd/provider_vdc.go Outdated Show resolved Hide resolved
govcd/api_json.go Outdated Show resolved Hide resolved
govcd/api_json.go Show resolved Hide resolved
govcd/network_pool.go Show resolved Hide resolved
govcd/system.go Outdated Show resolved Hide resolved
govcd/provider_vdc.go Show resolved Hide resolved
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Copy link
Collaborator

@Didainius Didainius left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think I am good in general, but body.Close() needs to be reviewed after calling executeJsonRequest

govcd/api_json.go Show resolved Hide resolved
govcd/api_json.go Show resolved Hide resolved
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Copy link
Collaborator

@adambarreiro adambarreiro left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Amazing work, very clean. Just a few doubts.

govcd/network_pool.go Outdated Show resolved Hide resolved
govcd/vsphere_vcenter.go Outdated Show resolved Hide resolved
govcd/system.go Show resolved Hide resolved
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Copy link
Contributor

@adezxc adezxc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approved, just some general questions/comments

govcd/api_json.go Outdated Show resolved Hide resolved
govcd/provider_vdc.go Outdated Show resolved Hide resolved
govcd/system.go Outdated Show resolved Hide resolved
govcd/vsphere_resource_pool.go Outdated Show resolved Hide resolved
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
Signed-off-by: Giuseppe Maxia <gmaxia@vmware.com>
@dataclouder dataclouder merged commit 91abc52 into vmware:main Jul 12, 2023
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

6 participants