From 3722a26f372662b14ae7f9941062da76093d3059 Mon Sep 17 00:00:00 2001 From: "JINDAT BARADIA GIRISH -X (jingiris - XORIANT SOLUTIONS PRIVATE LIMITED at Cisco)" Date: Wed, 8 Apr 2026 15:14:37 +0530 Subject: [PATCH] Adding examples. --- examples/firmware/DirectFirmwareUpgrade.ps1 | 24 +++++++++++++++ examples/os/InstallOS.ps1 | 34 +++++++++++++++++++++ 2 files changed, 58 insertions(+) diff --git a/examples/firmware/DirectFirmwareUpgrade.ps1 b/examples/firmware/DirectFirmwareUpgrade.ps1 index e69de29bb..0fd112775 100644 --- a/examples/firmware/DirectFirmwareUpgrade.ps1 +++ b/examples/firmware/DirectFirmwareUpgrade.ps1 @@ -0,0 +1,24 @@ +# Uncomment the following script and provide the below information to set up Intersight environment. +<# + $intersightEnv = @{ + BasePath = if ($env:INTERSIGHT_ENDPOINT) { $env:INTERSIGHT_ENDPOINT } else { "https://intersight.com" } + ApiKeyId = "xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx" + ApiKeyFilePath = "C:\\Users\\admin\\Downloads\\ProductionSecretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} + +Set-IntersightConfiguration @intersightEnv +#> + +$Source1 = Initialize-IntersightSoftwarerepositoryNfsServer -FileLocation "10.xx.xx.xx/shared/ucsc-845a-m8-huu-2.0.1.250000D.iso" -ObjectType "SoftwarerepositoryNfsServer" +$Account1 = Get-IntersightIamAccount -Name "my-account" +$Organization1 = Get-IntersightOrganizationOrganization -Name "test_new_org" -Account $Account1 +$Catalog1 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization1 +$FirmwareDistributable = New-IntersightFirmwareDistributable -Name "ucsc-845a-m8-huu-2.0.1.250000D" -ImportAction "None" -SupportedModels @("CAI-845A-M8") -Version "-" -Origin "User" -Source $Source1 -Catalog $Catalog1 +$Organization2 = Get-IntersightOrganizationOrganization -Name "test_new_org" -Account $Account1 +$Catalog2 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization2 +$UpdatedFirmwareDistributable = $FirmwareDistributable | Set-IntersightFirmwareDistributable -Source $Source1 -Version "2.0(1.250000D)" -Catalog $Catalog2 -Name "ucsc-845a-m8-huu-2.0.1.250000D" -SupportedModels @("CAI-845A-M8") -Description "invalid CIFS image" +$DirectDownload3 = Initialize-IntersightFirmwareDirectDownload -ObjectType "FirmwareDirectDownload" +$NetworkShare3 = Initialize-IntersightFirmwareNetworkShare -Upgradeoption "NwUpgradeFull" -MapType "Nfs" -ObjectType "FirmwareNetworkShare" +$Server3 = Get-IntersightComputeRackUnit -DeviceMoId "69a54b3a6f72613101af857f" -Dn "/redfish/v1/Systems/system" +$FirmwareUpgrade = New-IntersightFirmwareUpgrade -UpgradeType "NetworkUpgrade" -Distributable $UpdatedFirmwareDistributable -DirectDownload $DirectDownload3 -NetworkShare $NetworkShare3 -Server $Server3 -ExcludeComponentList @() \ No newline at end of file diff --git a/examples/os/InstallOS.ps1 b/examples/os/InstallOS.ps1 index e69de29bb..a440a51bd 100644 --- a/examples/os/InstallOS.ps1 +++ b/examples/os/InstallOS.ps1 @@ -0,0 +1,34 @@ +# Uncomment the following script and provide the below information to set up Intersight environment. +<# + $intersightEnv = @{ + BasePath = if ($env:INTERSIGHT_ENDPOINT) { $env:INTERSIGHT_ENDPOINT } else { "https://intersight.com" } + ApiKeyId = "xxxxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxx/xxxxxxxxxxxxxxxxxx" + ApiKeyFilePath = "C:\\Users\\admin\\Downloads\\ProductionSecretKey.txt" + HttpSigningHeader = @("(request-target)", "Host", "Date", "Digest") +} + +Set-IntersightConfiguration @intersightEnv +#> + +$Servers11 = Get-IntersightComputeRackUnit -DeviceMoId "698d5fcb6f726131016e23d4" -Dn "sys/rack-unit-1" +$ValidInstallTarget = New-IntersightOsValidInstallTarget -Servers @($Servers11) +$OsSupport = New-IntersightOsOsSupport -OsVersion "ESXi 8.0" +$Account1 = Get-IntersightIamAccount -Name "my-account" +$Organization1 = Get-IntersightOrganizationOrganization -Name "Org-Auto-8332" -Account $Account1 +$Catalog1 = Get-IntersightSoftwarerepositoryCatalog -Name "user-catalog" -Organization $Organization1 +$Image31 = Get-IntersightSoftwarerepositoryOperatingSystemFile -Name "Esxi80u2_embedded" -Catalog $Catalog1 +$OsduImage31 = Get-IntersightFirmwareServerConfigurationUtilityDistributable -Name "ucsxe-scu-7.1.7.260010.iso" -Catalog $Catalog1 +$IpV4Config31 = Initialize-IntersightCommIpV4Interface -ObjectType "CommIpV4Interface" -Gateway "" -IpAddress "" -Netmask "" +$IpConfiguration31 = Initialize-IntersightOsIpv4Configuration -ObjectType "OsIpv4Configuration" -IpV4Config $IpV4Config31 +$Answers31 = Initialize-IntersightOsAnswers -ObjectType "OsAnswers" -Hostname "google" -IpConfigType "DHCP" -IpConfiguration $IpConfiguration31 -IsRootPasswordCrypted $false -Nameserver "" -NetworkDevice "" -ProductKey "" -Source "Template" -RootPassword "123456" +$Organization4 = Get-IntersightOrganizationOrganization -Moid "5da9f0b76972652d30b3bae7" +if ($Organization4) { + $Catalog3 = Get-IntersightOsCatalog -Name "shared" -Organization $Organization4 +} else { + $Catalog3 = Get-IntersightOsCatalog -Name "shared" +} +$ConfigurationFile31 = Get-IntersightOsConfigurationFile -Name "ESXi8.0ConfigFile" -Catalog $Catalog3 +$InstallTarget31 = Initialize-IntersightOsPhysicalDisk -ObjectType "OsPhysicalDisk" -Name "Disk 1" -SerialNumber "W0K40V960000K141L1Z5" -StorageControllerSlotId "MRAID" +$Body31 = Initialize-IntersightOsInstall -Description "" -InstallMethod "VMedia" -Image $Image31 -OsduImage $OsduImage31 -OverrideSecureBoot $true -Organization $Organization1 -Answers $Answers31 -ConfigurationFile $ConfigurationFile31 -InstallTarget $InstallTarget31 -Server $Servers11 +$Requests13 = Initialize-IntersightBulkRestSubRequest -ObjectType "BulkRestSubRequest" -Body $Body31 +$BulkInstallRequest = New-IntersightBulkRequest -Verb "POST" -Uri "/v1/os/Installs" -Requests @($Requests13) \ No newline at end of file