Package com.pulumi.openstack.compute
Class ServerGroup
- java.lang.Object
-
- com.pulumi.resources.Resource
-
- com.pulumi.resources.CustomResource
-
- com.pulumi.openstack.compute.ServerGroup
-
public class ServerGroup extends com.pulumi.resources.CustomResourceManages a V2 Server Group resource within OpenStack. ## Example Usage ### Compute service API version 2.63 or below: ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.compute.ServerGroup; import com.pulumi.openstack.compute.ServerGroupArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var test_sg = new ServerGroup("test-sg", ServerGroupArgs.builder() .policies("anti-affinity") .build()); } } ``` ### Compute service API version 2.64 or above: ```java package generated_program; import com.pulumi.Context; import com.pulumi.Pulumi; import com.pulumi.core.Output; import com.pulumi.openstack.compute.ServerGroup; import com.pulumi.openstack.compute.ServerGroupArgs; import com.pulumi.openstack.compute.inputs.ServerGroupRulesArgs; import java.util.List; import java.util.ArrayList; import java.util.Map; import java.io.File; import java.nio.file.Files; import java.nio.file.Paths; public class App { public static void main(String[] args) { Pulumi.run(App::stack); } public static void stack(Context ctx) { var test_sg = new ServerGroup("test-sg", ServerGroupArgs.builder() .policies("anti-affinity") .rules(ServerGroupRulesArgs.builder() .maxServerPerHost(3) .build()) .build()); } } ``` ## Policies * `affinity` - All instances/servers launched in this group will be hosted on the same compute node. * `anti-affinity` - All instances/servers launched in this group will be hosted on different compute nodes. * `soft-affinity` - All instances/servers launched in this group will be hosted on the same compute node if possible, but if not possible they still will be scheduled instead of failure. To use this policy your OpenStack environment should support Compute service API 2.15 or above. * `soft-anti-affinity` - All instances/servers launched in this group will be hosted on different compute nodes if possible, but if not possible they still will be scheduled instead of failure. To use this policy your OpenStack environment should support Compute service API 2.15 or above. ## Import Server Groups can be imported using the `id`, e.g. ```sh $ pulumi import openstack:compute/serverGroup:ServerGroup test-sg 1bc30ee9-9d5b-4c30-bdd5-7f1e663f5edf ```
-
-
Constructor Summary
Constructors Constructor Description ServerGroup(java.lang.String name)ServerGroup(java.lang.String name, ServerGroupArgs args)ServerGroup(java.lang.String name, ServerGroupArgs args, com.pulumi.resources.CustomResourceOptions options)
-
Method Summary
All Methods Static Methods Instance Methods Concrete Methods Modifier and Type Method Description static ServerGroupget(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, ServerGroupState state, com.pulumi.resources.CustomResourceOptions options)Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.com.pulumi.core.Output<java.util.List<java.lang.String>>members()com.pulumi.core.Output<java.lang.String>name()com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>>policies()com.pulumi.core.Output<java.lang.String>region()com.pulumi.core.Output<ServerGroupRules>rules()com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>>>valueSpecs()
-
-
-
Constructor Detail
-
ServerGroup
public ServerGroup(java.lang.String name)
- Parameters:
name- The _unique_ name of the resulting resource.
-
ServerGroup
public ServerGroup(java.lang.String name, @Nullable ServerGroupArgs args)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.
-
ServerGroup
public ServerGroup(java.lang.String name, @Nullable ServerGroupArgs args, @Nullable com.pulumi.resources.CustomResourceOptions options)- Parameters:
name- The _unique_ name of the resulting resource.args- The arguments to use to populate this resource's properties.options- A bag of options that control this resource's behavior.
-
-
Method Detail
-
members
public com.pulumi.core.Output<java.util.List<java.lang.String>> members()
- Returns:
- The instances that are part of this server group.
-
name
public com.pulumi.core.Output<java.lang.String> name()
- Returns:
- A unique name for the server group. Changing this creates a new server group.
-
policies
public com.pulumi.core.Output<java.util.Optional<java.util.List<java.lang.String>>> policies()
- Returns:
- A list of exactly one policy name to associate with the server group. See the Policies section for more information. Changing this creates a new server group.
-
region
public com.pulumi.core.Output<java.lang.String> region()
- Returns:
- The region in which to obtain the V2 Compute client. If omitted, the `region` argument of the provider is used. Changing this creates a new server group.
-
rules
public com.pulumi.core.Output<ServerGroupRules> rules()
- Returns:
- The rules which are applied to specified `policy`. Currently, only the `max_server_per_host` rule is supported for the `anti-affinity` policy.
-
valueSpecs
public com.pulumi.core.Output<java.util.Optional<java.util.Map<java.lang.String,java.lang.Object>>> valueSpecs()
- Returns:
- Map of additional options.
-
get
public static ServerGroup get(java.lang.String name, com.pulumi.core.Output<java.lang.String> id, @Nullable ServerGroupState state, @Nullable com.pulumi.resources.CustomResourceOptions options)
Get an existing Host resource's state with the given name, ID, and optional extra properties used to qualify the lookup.- Parameters:
name- The _unique_ name of the resulting resource.id- The _unique_ provider ID of the resource to lookup.state-options- Optional settings to control the behavior of the CustomResource.
-
-