-
Notifications
You must be signed in to change notification settings - Fork 5
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
Initialize-IntersightBulkSubRequest and New-IntersightBulkRequest documentation/examples #126
Comments
It would be good to understand the error message and cmdlet usage if you provide the cmdlet details along with error message, The issue which I have referred above is due to the body parameter type which is of type MoBaseMo. and when you use Initialize-Intersight-MoBaseMo there is no property of your choice to configure it. Here is the work around to resolve the type issue. # Initialize a dotnet dictionary and add all the property with the respective value
$d = [System.Collections.Generic.Dictionary[String,Object]]::new()
$d.Add("AutoAllowOnUplinks",$true)
$d.Add("EthNetworkPolicy","78654367900345676543")
$d.Add("IsNative",$false)
$d.Add("MulticastPolicy","7589876234567")
$d.Add("PrimaryVlanId",0)
$d.Add("VlanId",15)
# cmdlet Initailze-IntersightMoBaseMo.
$moBase = Initialize-IntersightMoBaseMo -AdditionalProperties $d
# Now pass the object received from Initialize-IntersightMoBaseMo to Initailze-IntersightBulkRestSubRequest Body parameter.
$Requests13 = Initialize-IntersightBulkRestSubRequest -Body $moBase -ObjectType "BulkRestSubRequest" -Clas
sId "BulkRestSubRequest"
$result. = New-IntersightBulkRequest -Requests @($Requests13) -Uri "/v1/fabric/Vlans" -Verb "POST"
Please try this workaround. |
Thanks! I'll give this a try. Another couple of questions based on your example: Additionally, should the URI also be specified in the I need to ensure that I'm 100% targeting only the Intersight Appliance containing the targeted profile, as we have multiple appliances. |
Provide shorter Use |
Okay; another quick question based on my attempts thus far. I'm setting up my SubRequests as follows $d = [System.Collections.Generic.Dictionary[String,Object]]::new()
$d.Add("AssignedServer",$ServerMoMoRef)
$d.Add("ScheduledActions",@($ScheduledAction1,$ScheduledAction2))
$moBase = Initialize-IntersightMoBaseMo -AdditionalProperties $d
$SubRequest = Initialize-IntersightBulkRestSubRequest -Body $moBase -ObjectType "BulkRestSubRequest" -Clas
sId "BulkRestSubRequest" -Uri "/v1/server/Profiles" -Verb "PATCH" -TargetMoId $ProfileMoId I then add each Profile's SubRequest to a Hash Table where the name of the Intersight CVA is the Key and the Value is all of the SubRequests for that Intersight Appliance, for instance: However, when I attempt to run |
@Ghufz Apologies for the long delay; I have examples! Here is an attempt to Assign a profile to a Server, Deploy the profile, and Activate with Reboot: Here is an attempt to only Assign a profile to a Server: Given your examples, I know there's a difference - the primary one being that I'm using a Managed Object reference for one Dictionary entry, and two Policy Scheduled Action objects in another. Any insight? |
Good morning!
I'm attempting to create something that would allow me to bulk-assign, bulk-deploy, and bulk-activate multiple Server Profiles at once. While the provided examples for doing this using Scheduled Actions are excellent for one-off Assign/Deploy/Activate actions, I'm having trouble working out a bulk process.
I've attempted using
Initialize-IntersightBulkSubRequest
withNew-IntersightBulkRequest
, but I haven't had much success.Is there any further documentation on how these functions work? There don't appear to be any examples in the project.
The text was updated successfully, but these errors were encountered: