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

Add QueryDisks #255

Merged
merged 3 commits into from
Oct 23, 2019
Merged

Add QueryDisks #255

merged 3 commits into from
Oct 23, 2019

Conversation

vbauzys
Copy link
Contributor

@vbauzys vbauzys commented Oct 22, 2019

  • Add QueryDisks using name
    Function needed to handle independent disk read/import by Id

Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

Some minor corrections needed

govcd/disk.go Outdated
func (vdc *Vdc) QueryDisks(diskName string) (*[]*types.DiskRecordType, error) {

if diskName == "" {
return nil, fmt.Errorf("disk name can not be empty")
Copy link
Contributor

Choose a reason for hiding this comment

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

"can not" => "can't"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

govcd/disk.go Outdated

results, err := vdc.QueryWithNotEncodedParams(nil, map[string]string{"type": typeMedia, "filter": "name==" + url.QueryEscape(diskName)})
if err != nil {
return nil, fmt.Errorf("error querying disk %#v", err)
Copy link
Contributor

Choose a reason for hiding this comment

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

"%#v" => "%s"

Copy link
Contributor Author

Choose a reason for hiding this comment

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

updated

govcd/disk.go Show resolved Hide resolved
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
Copy link
Contributor

@dataclouder dataclouder left a comment

Choose a reason for hiding this comment

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

LGTM

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.

One comment not set as per go doc standard

govcd/disk.go Outdated Show resolved Hide resolved
Signed-off-by: Vaidotas Bauzys <vbauzys@vmware.com>
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.

LGTM and I think it's the first use case of *[]*in our code base ;)

@vbauzys vbauzys merged commit a024176 into vmware:master Oct 23, 2019
funky81 added a commit to funky81/go-vcloud-director that referenced this pull request Oct 24, 2019
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.

5 participants