Giter Site home page Giter Site logo

nttlimitedrd / compute.api.powershell Goto Github PK

View Code? Open in Web Editor NEW
9.0 29.0 4.0 14.05 MB

A C# client library and PowerShell cmdlets for the Dimension Data CaaS API

License: MIT License

C# 66.69% HTML 2.26% CSS 8.69% JavaScript 8.77% PowerShell 13.40% Smalltalk 0.20%

compute.api.powershell's Introduction

Compute.Api.Powershell

Build status

PowerShell cmdlets for the Dimension Data CaaS API.

This is the source code from the team that have put together the client libraries based on the REST API spec published online

Downloads

This is the source code for PowerShell cmdlets, MSI are available on the latest release https://github.com/DimensionDataCBUSydney/Compute.Api.Powershell/releases/latest

Usage

Usage examples are shown on the automation blog for the PowerShell. http://caas-automation.blogspot.com.au/

Terms

This library has been provided as a utility for clients wishing to integrate the CaaS API into any .NET services, it does not form part of a service provided by Dimension Data. This utility is provided 'as-is' and Dimension Data cannot provide support for its usage.

compute.api.powershell's People

Contributors

alexbacchin avatar kevintchen avatar manishkp avatar philiplaureano avatar priyansadar avatar riveryc avatar saanch avatar samuelchong avatar tintoy avatar tonybaloney avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

compute.api.powershell's Issues

Form Hangs on New-CaaSConnection

Greetings,

I am able to use the New-CaaSConnection command manually via a PowerShell window and it works fine. However, I'm attempting to build out a form based in PowerShell. Login page is already made and scripted. However, when it attempts to run the New-CaaSConnection command via that process, it just hangs and never connects or does anything further.

I've copy/pasted the exact same process into PowerShell manually and it works fine. Not sure why that would be, and I'm not even sure if this is the right place to submit this as an issue, but it is strange.

Get-CaasNetworkDomain and New-CaasNetworkDomain, parameter should be consistent

New-CaasNetworkDomain has "Location", which refers to Get-CaasNetworkDomain's "DatacenterId".
I think we'd better keep one name as "DatacenterId" rather than "Location" as it's using "DatacenterId" in the web API.

Any suggestion?
If you guys are all OK with this, I'll go ahead to change it in New-CaasNetworkDomain.

Thanks
River

Issue with the wait state when doing a Server config change

Hi Team,

We are trying to change the server config by Shutting down the server, changing the config and then starting the server again. The below script does run through and works but it also generates this exception. Hence though of asking you to help if i am missing something here.
Out-CaasWaitForOperation : The input object cannot be bound to any parameters for the command either because the command does not take pipeline input or the input and its properties do not
match any of the parameters that take pipeline input.
At C:\Scripts\CloudAPIServerChangeSpecs\serverchangespecs.ps1:16 char:63

  • Set-CaasServer -CPUCount 2 -MemoryInMB $Memory4GB -PassThru | Out-CaasWaitForOpe ...
  •                                                           ~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (DD.CBU.Compute.....General.Status:PSObject) [Wait-CaasServerOperation], ParameterBindingException
    • FullyQualifiedErrorId : InputObjectNotBound,DD.CBU.Compute.Powershell.WaitCaasServerOperationCmdlet

Script:
foreach ( $serverName in $serverNames ) {
$server = Get-CaasServers -Name $serverName -Network $prodNetwork
if ($server.started -eq "True" ){
Write-Output "$serverName is running"
Set-CaasServerState -Action PowerOff -Server $server -PassThru | Out-CaasWaitForOperation | Set-CaasServer -CPUCount 2 -MemoryInMB $Memory4GB -PassThru | Out-CaasWaitForOperation |
Set-CaasServerState -Action PowerOn
Start-Sleep 30
Write-Output "$serverName has been updated with new config"
Get-CaasServers -Name $serverName -Network $prodNetwork
}
else
{
Write-Output "$serverName is Not Running"
}

New-CaasServerDetails not working with Customer Templates

Wonder if someone can point me in the right direction.

I trying to create a VM form a customer template using powershell. If using the following command:

$serverDetails = New-CaasServerDetails -Name $machineName -AdminPassword $adminPass -IsStarted $powerState -NetworkDomain $networkdomain -PrimaryVlan $vlan -PrimaryDns $primarydns -SecondaryDns $secondarydns -ServerImage $serverImage -CpuSpeed $vcputype -CpuCount $vcpu -MemoryGb $vram -CpuCoresPerSocket 1

I get the following message:

New-CaasServerDetails : ServerImage type cannot be converted to DD.CBU.Compute.Api.Contracts.Image.ImagesWithDiskSpeedImageor
toDD.CBU.Compute.Api.Contracts.Network20.OsImageType
At C:\support store\Server Builder\VMBuilder.ps1:231 char:26

  •     $serverDetails = New-CaasServerDetails -Name $machineName -AdminPassword ...
    
  •   + CategoryInfo          : InvalidArgument: (:) [New-CaasServerDetails], ArgumentException
      + FullyQualifiedErrorId : -3,DD.CBU.Compute.Powershell.NewCaasServerDetailsCmdlet 
    
    

Can I use powershell to create a Virtual machine from a customer template?
What does ImagesWithDiskSpeedImage mean?

drsEligible is incomplete

The API documentation states that the drsEligible should either contain true/false or the consistencyGroup if it was configured in a consistency group.

The current drsEligible type only defines a default constructor.

    [DebuggerStepThrough]
    [DesignerCategory("code")]
    [GeneratedCode("xsd", "4.6.1055.0")]
    [XmlRoot("drsEligible", Namespace = "urn:didata.com:api:cloud:types")]
    [XmlType(Namespace = "urn:didata.com:api:cloud:types")]
    public class drsEligible
    {
        public drsEligible();
    }

Feature request - implement ToString() overrides on complex types in ServerType

The response of Get-CaasServers is not great to read because there are so many complex types in the field list.

We should implement ToString overrides to types like OperatingSystemType, ServerTypeNetworkInfo

operatingSystem : DD.CBU.Compute.Api.Contracts.Network20.OperatingSystemType
cpu             : DD.CBU.Compute.Api.Contracts.Network20.CpuType
memoryGb        : 4
disk            : {129135ed-96dd-48fe-90f1-60fa962c34ed}
Item            : DD.CBU.Compute.Api.Contracts.Network20.ServerTypeNetworkInfo
backup          : 
monitoring      : 
softwareLabel   : 
sourceImageId   : 0fcabe1a-df59-4dab-b552-050ba9dc675f
createTime      : 5/26/2016 2:07:34 AM
deployed        : True
started         : False
state           : NORMAL
progress        : 
vmwareTools     : DD.CBU.Compute.Api.Contracts.Network20.VmwareToolsType
virtualHardware : DD.CBU.Compute.Api.Contracts.Network20.VirtualHardwareType
id              : e7d756dd-084d-45ab-bd4d-241b85f156b4
datacenterId    : AU9

Remove-CaasServer (enhancement)

Cannot remove multiple servers at the same time, with following error message:
Remove-CaasServer : , Error:BadRequest,
Uri:https://api-au.dimensiondata.com/oec/0.9/1578108f-e4aa-4ab7-8b2b-b9244482df93/server/04f88390-265c-4269-b18e-1556dc8ab815?deleteCaaSOperationStatus: {"operation":"Delete
Server","result":"ERROR","resultDetail":"Another operation is in progress on Server with Id 04f88390-265c-4269-b18e-1556dc8ab815. Please try again
later.","resultCode":"REASON_392","additionalInformation":null}

As we can remove multiple servers in CaaS UI, should we have the same ability in PS Module?
In this case, we can create or remove multiple servers at the same time.

Thanks
River

Set-CaasServerState Cannot bind parameter 'Server'.

Hi Team,
Not sure if this is the right place to post this but couldn't find anywhere else. The DD dev portal doesn't allow either. I am using the latest powershell module and having this issue to shutdown a server uisng it's name. I do understand that All commands expecting the -Server parameter must use the Get-CaasServer but can't figure out to pass that . Hoping that you could help.

command:
Set-CaasServerState -Action Shutdown -Server myservername

Error received:
et-CaasServerState : Cannot bind parameter 'Server'. Cannot convert the myservername value of type
"System.String" to type "DD.CBU.Compute.Api.Contracts.Server.ServerWithBackupType".
At line:1 char:48

  • Set-CaasServerState -Action Shutdown -Server myservername
  •                                            ~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Set-CaasServerState], ParameterBindingException
    • FullyQualifiedErrorId : CannotConvertArgumentNoMessage,DD.CBU.Compute.Powershell.SetCaasServerActionCmdlet

Enable Backup with Email address

HI, I am trying to use Add-CaasBackupClient command however when I try to use the email address I get the following error message.

Command
$link = Add-CaasBackupClient -Server $server -StoragePolicy $stoPolicy -SchedulePolicy $schPolicy -ClientType $clientType -Trigger ON_SUCCESS_OR_FAILURE -EmailAddresses [[email protected]]

Error
Add-CaasBackupClient : Cannot bind parameter 'EmailAddresses'. Cannot convert the "[[email protected]]" value of type "System.String" to type
"System.Collections.Generic.IReadOnlyList`1[System.String]".
At line:1 char:170

  • ... e -Trigger ON_SUCCESS_OR_FAILURE -EmailAddresses [[email protected]]
  •                                                  ~~~~~~~~~~~~~~~~~~~~
    
    • CategoryInfo : InvalidArgument: (:) [Add-CaasBackupClient], ParameterBindingException
    • FullyQualifiedErrorId : CannotConvertArgumentNoMessage,DD.CBU.Compute.Powershell.AddCaasBackupClientCmdlet

Other trials
I have also tried different formats of the email address, however they all error
@([email protected])
@("[email protected]")
"[email protected]"
["[email protected]"]
[[email protected]]

Any help would be appreciated.
Thanks.

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.