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

ConvertTo-nbId not working for clusters #31

Open
steinbachio opened this issue Oct 30, 2019 · 4 comments
Open

ConvertTo-nbId not working for clusters #31

steinbachio opened this issue Oct 30, 2019 · 4 comments
Assignees

Comments

@steinbachio
Copy link

As clusters don't have a slug, ConvertTo-nbId needs an additional check for clusters like this.

try {
    if ($source -match '.*\/_choices') {
        Return Invoke-nbApi -resource ($source) |
            Where-object label -eq $value |
            Select-Object -ExpandProperty value
    }
    # insertion below
    if($Source -eq 'virtualization/clusters') {
        Return (Invoke-nbApi -Resource ($Source) -Query @{name = $Value}).results[0].id
    }
    # end insertion
    Return (Invoke-nbApi -resource ($source) -Query @{slug = $Value}).results[0].id
}
@steinbachio
Copy link
Author

Same applies to VirtualMachines

if($Source -eq 'virtualization/virtual-machines') {
    Return (Invoke-nbApi -Resource ($Source) -Query @{name = $Value}).results[0].id
}

@BatmanAMA BatmanAMA self-assigned this Oct 30, 2019
@BatmanAMA
Copy link
Owner

Good call!

@steinbachio
Copy link
Author

  • IP-Addresses
if($Source -eq 'ipam/ip-addresses') {
    Return (Invoke-nbApi -Resource ($Source) -Query @{address = $Value}).results[0].id
}

@steinbachio
Copy link
Author

You saved us many hours of work with this module. Could you provide us your paypal address or something? You can send it to [email protected] if you prefer to not have it posted here.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants