@@ -32,7 +32,7 @@ Various documentation is available to help you get started
3232<dependency >
3333 <groupId >com.azure.resourcemanager</groupId >
3434 <artifactId >azure-resourcemanager-computefleet</artifactId >
35- <version >1.0.0-beta.2 </version >
35+ <version >1.0.0</version >
3636</dependency >
3737```
3838[ // ] : # ( {x-version-update-end} )
@@ -70,6 +70,132 @@ See [API design][design] for general introduction on design and key concepts on
7070
7171## Examples
7272
73+ ``` java
74+ Network network = networkManager. networks()
75+ .define(vnetName)
76+ .withRegion(REGION )
77+ .withExistingResourceGroup(resourceGroupName)
78+ .withAddressSpace(" 172.16.0.0/16" )
79+ .defineSubnet(" default" )
80+ .withAddressPrefix(" 172.16.0.0/24" )
81+ .attach()
82+ .create();
83+
84+ LoadBalancer loadBalancer = networkManager. loadBalancers()
85+ .define(loadBalancerName)
86+ .withRegion(REGION )
87+ .withExistingResourceGroup(resourceGroupName)
88+ .defineLoadBalancingRule(loadBalancerName + " -lbrule" )
89+ .withProtocol(TransportProtocol . TCP )
90+ .fromExistingSubnet(network, " default" )
91+ .fromFrontendPort(80 )
92+ .toBackend(loadBalancerName + " -backend" )
93+ .toBackendPort(80 )
94+ .attach()
95+ .withSku(LoadBalancerSkuType . STANDARD )
96+ .create();
97+
98+ fleet = computeFleetManager. fleets()
99+ .define(fleetName)
100+ .withRegion(REGION )
101+ .withExistingResourceGroup(resourceGroupName)
102+ .withProperties(
103+ new FleetProperties ()
104+ .withSpotPriorityProfile(
105+ new SpotPriorityProfile ()
106+ .withMaintain(false )
107+ .withCapacity(1 )
108+ .withEvictionPolicy(EvictionPolicy . DELETE )
109+ .withAllocationStrategy(SpotAllocationStrategy . LOWEST_PRICE )
110+ )
111+ .withVmSizesProfile(
112+ Arrays . asList(
113+ new VmSizeProfile (). withName(" Standard_D4s_v3" )
114+ )
115+ )
116+ .withComputeProfile(
117+ new ComputeProfile ()
118+ .withBaseVirtualMachineProfile(
119+ new BaseVirtualMachineProfile ()
120+ .withStorageProfile(
121+ new VirtualMachineScaleSetStorageProfile ()
122+ .withImageReference(
123+ new ImageReference ()
124+ .withPublisher(" canonical" )
125+ .withOffer(" ubuntu-24_04-lts" )
126+ .withSku(" server" )
127+ .withVersion(" latest" )
128+ )
129+ .withOsDisk(
130+ new VirtualMachineScaleSetOSDisk ()
131+ .withManagedDisk(
132+ new VirtualMachineScaleSetManagedDiskParameters ()
133+ .withStorageAccountType(StorageAccountTypes . PREMIUM_LRS )
134+ )
135+ .withOsType(OperatingSystemTypes . LINUX )
136+ .withDiskSizeGB(30 )
137+ .withCreateOption(DiskCreateOptionTypes . FROM_IMAGE )
138+ .withDeleteOption(DiskDeleteOptionTypes . DELETE )
139+ .withCaching(CachingTypes . READ_WRITE )
140+ )
141+ .withDiskControllerType(DiskControllerTypes . SCSI )
142+ )
143+ .withOsProfile(
144+ new VirtualMachineScaleSetOSProfile ()
145+ .withComputerNamePrefix(randomPadding())
146+ .withAdminUsername(adminUser)
147+ .withAdminPassword(adminPwd)
148+ .withLinuxConfiguration(
149+ new LinuxConfiguration (). withDisablePasswordAuthentication(false )
150+ )
151+ )
152+ .withNetworkProfile(
153+ new VirtualMachineScaleSetNetworkProfile ()
154+ .withNetworkInterfaceConfigurations(
155+ Arrays . asList(
156+ new VirtualMachineScaleSetNetworkConfiguration ()
157+ .withName(vmName)
158+ .withProperties(
159+ new VirtualMachineScaleSetNetworkConfigurationProperties ()
160+ .withPrimary(true )
161+ .withEnableAcceleratedNetworking(false )
162+ .withDeleteOption(DeleteOptions . DELETE )
163+ .withIpConfigurations(
164+ Arrays . asList(
165+ new VirtualMachineScaleSetIPConfiguration ()
166+ .withName(vmName)
167+ .withProperties(
168+ new VirtualMachineScaleSetIPConfigurationProperties ()
169+ .withPrimary(true )
170+ .withSubnet(
171+ new ApiEntityReference ()
172+ .withId(network. subnets(). get(" default" ). id())
173+ )
174+ .withLoadBalancerBackendAddressPools(
175+ loadBalancer. loadBalancingRules()
176+ .get(loadBalancerName + " -lbrule" )
177+ .innerModel(). backendAddressPools()
178+ )
179+ )
180+ )
181+ )
182+ )
183+ )
184+ )
185+ .withNetworkApiVersion(NetworkApiVersion . fromString(" 2024-03-01" ))
186+ )
187+ )
188+ .withComputeApiVersion(" 2024-03-01" )
189+ .withPlatformFaultDomainCount(1 )
190+ )
191+ .withRegularPriorityProfile(new RegularPriorityProfile ()
192+ .withAllocationStrategy(RegularPriorityAllocationStrategy . LOWEST_PRICE )
193+ .withMinCapacity(1 )
194+ .withCapacity(2 )
195+ )
196+ )
197+ .create();
198+ ```
73199[ Code snippets and samples] ( https://github.com/Azure/azure-sdk-for-java/blob/main/sdk/computefleet/azure-resourcemanager-computefleet/SAMPLE.md )
74200
75201
0 commit comments