pub struct ServerBuilder<'a> { /* private fields */ }
Expand description
Builder for Server
.
Implementations§
Source§impl<'a> ServerBuilder<'a>
impl<'a> ServerBuilder<'a>
Sourcepub fn access_ipv4<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn access_ipv4<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
IPv4 address that should be used to access this server.
Sourcepub fn access_ipv6<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn access_ipv6<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
IPv6 address that should be used to access this server.
Sourcepub fn admin_pass<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn admin_pass<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
The administrative password of the server. If you omit this parameter, the operation generates a new password.
Sourcepub fn availability_zone<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn availability_zone<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
A target cell name. Schedule the server in a host in the cell
specified. It is available when TargetCellFilter
is available on
cloud side that is cell v1 environment.
pub fn block_device_mapping<VALUE: Into<Vec<BlockDeviceMapping<'a>>>>( &mut self, value: VALUE, ) -> &mut Self
Sourcepub fn block_device_mapping_v2<VALUE: Into<Vec<BlockDeviceMappingV2<'a>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn block_device_mapping_v2<VALUE: Into<Vec<BlockDeviceMappingV2<'a>>>>( &mut self, value: VALUE, ) -> &mut Self
Enables fine grained control of the block device mapping for an instance. This is typically used for booting servers from volumes. An example format would look as follows:
"block_device_mapping_v2": [{ "boot_index": "0", "uuid": "ac408821-c95a-448f-9292-73986c790911", "source_type": "image", "volume_size": "25", "destination_type": "volume", "delete_on_termination": true, "tag": "disk1", "disk_bus": "scsi"}]
In microversion 2.32, tag
is an optional string attribute that can be
used to assign a tag to the block device. This tag is then exposed to
the guest in the metadata API and the config drive and is associated to
hardware metadata for that block device, such as bus (ex: SCSI), bus
address (ex: 1:0:2:0), and serial.
A bug has caused the tag
attribute to no longer be accepted starting
with version 2.33. It has been restored in version 2.42.
Sourcepub fn config_drive<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
pub fn config_drive<VALUE: Into<bool>>(&mut self, value: VALUE) -> &mut Self
Indicates whether a config drive enables metadata injection. The
config_drive setting provides information about a drive that the
instance can mount at boot time. The instance reads files from the
drive to get information that is normally available through the
metadata service. This metadata is different from the user data. Not
all cloud providers enable the config_drive
. Read more in the
OpenStack End User Guide.
Sourcepub fn description<VALUE: Into<Option<Cow<'a, str>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn description<VALUE: Into<Option<Cow<'a, str>>>>( &mut self, value: VALUE, ) -> &mut Self
A free form description of the server. Limited to 255 characters in length. Before microversion 2.19 this was set to the server name.
New in version 2.19
Sourcepub fn flavor_ref<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn flavor_ref<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
The flavor reference, as an ID (including a UUID) or full URL, for the flavor for your server instance.
Sourcepub fn image_ref<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn image_ref<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
The UUID of the image to use for your server instance. This is not required in case of boot from volume. In all other cases it is required and must be a valid UUID otherwise API will return 400.
Sourcepub fn key_name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
pub fn key_name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
A target cell name. Schedule the server in a host in the cell
specified. It is available when TargetCellFilter
is available on
cloud side that is cell v1 environment.
pub fn max_count<VALUE: Into<i32>>(&mut self, value: VALUE) -> &mut Self
pub fn min_count<VALUE: Into<i32>>(&mut self, value: VALUE) -> &mut Self
Sourcepub fn name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
pub fn name<VALUE: Into<Cow<'a, str>>>(&mut self, value: VALUE) -> &mut Self
A target cell name. Schedule the server in a host in the cell
specified. It is available when TargetCellFilter
is available on
cloud side that is cell v1 environment.
Sourcepub fn networks<VALUE: Into<Vec<Networks<'a>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn networks<VALUE: Into<Vec<Networks<'a>>>>( &mut self, value: VALUE, ) -> &mut Self
A list of network
object. Required parameter when there are multiple
networks defined for the tenant. When you do not specify the networks
parameter, the server attaches to the only network created for the
current tenant. Optionally, you can create one or more NICs on the
server. To provision the server instance with a NIC for a network,
specify the UUID of the network in the uuid
attribute in a networks
object. To provision the server instance with a NIC for an already
existing port, specify the port-id in the port
attribute in a
networks
object.
If multiple networks are defined, the order in which they appear in the
guest operating system will not necessarily reflect the order in which
they are given in the server boot request. Guests should therefore not
depend on device order to deduce any information about their network
devices. Instead, device role tags should be used: introduced in 2.32,
broken in 2.37, and re-introduced and fixed in 2.42, the tag
is an
optional, string attribute that can be used to assign a tag to a
virtual network interface. This tag is then exposed to the guest in the
metadata API and the config drive and is associated to hardware
metadata for that network interface, such as bus (ex: PCI), bus address
(ex: 0000:00:02.0), and MAC address.
A bug has caused the tag
attribute to no longer be accepted starting
with version 2.37. Therefore, network interfaces could only be tagged
in versions 2.32 to 2.36 inclusively. Version 2.42 has restored the
tag
attribute.
Starting with microversion 2.37, this field is required and the special string values auto and none can be specified for networks. auto tells the Compute service to use a network that is available to the project, if one exists. If one does not exist, the Compute service will attempt to automatically allocate a network for the project (if possible). none tells the Compute service to not allocate a network for the instance. The auto and none values cannot be used with any other network values, including other network uuids, ports, fixed IPs or device tags. These are requested as strings for the networks value, not in a list. See the associated example.
Sourcepub fn os_dcf_disk_config(&mut self, value: OsDcfDiskConfig) -> &mut Self
pub fn os_dcf_disk_config(&mut self, value: OsDcfDiskConfig) -> &mut Self
Controls how the API partitions the disk when you create, rebuild, or
resize servers. A server inherits the OS-DCF:diskConfig
value from
the image from which it was created, and an image inherits the
OS-DCF:diskConfig
value from the server from which it was created. To
override the inherited setting, you can include this attribute in the
request body of a server create, rebuild, or resize request. If the
OS-DCF:diskConfig
value for an image is MANUAL
, you cannot create a
server from that image and set its OS-DCF:diskConfig
value to AUTO
.
A valid value is:
AUTO
. The API builds the server with a single partition the size of the target flavor disk. The API automatically adjusts the file system to fit the entire partition.MANUAL
. The API builds the server by using whatever partition scheme and file system is in the source image. If the target flavor disk is larger, the API does not partition the remaining disk space.
Sourcepub fn personality<VALUE: Into<Vec<Personality<'a>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn personality<VALUE: Into<Vec<Personality<'a>>>>( &mut self, value: VALUE, ) -> &mut Self
The file path and contents, text only, to inject into the server at launch. The maximum size of the file path data is 255 bytes. The maximum limit is the number of allowed bytes in the decoded, rather than encoded, data.
Available until version 2.56
Sourcepub fn return_reservation_id<VALUE: Into<bool>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn return_reservation_id<VALUE: Into<bool>>( &mut self, value: VALUE, ) -> &mut Self
Indicates whether a config drive enables metadata injection. The
config_drive setting provides information about a drive that the
instance can mount at boot time. The instance reads files from the
drive to get information that is normally available through the
metadata service. This metadata is different from the user data. Not
all cloud providers enable the config_drive
. Read more in the
OpenStack End User Guide.
Sourcepub fn security_groups<VALUE: Into<Vec<SecurityGroups<'a>>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn security_groups<VALUE: Into<Vec<SecurityGroups<'a>>>>( &mut self, value: VALUE, ) -> &mut Self
One or more security groups. Specify the name of the security group in
the name
attribute. If you omit this attribute, the API creates the
server in the default
security group. Requested security groups are
not applied to pre-existing ports.
Sourcepub fn user_data<VALUE: Into<Cow<'a, str>>>(
&mut self,
value: VALUE,
) -> &mut Self
pub fn user_data<VALUE: Into<Cow<'a, str>>>( &mut self, value: VALUE, ) -> &mut Self
Configuration information or scripts to use upon launch. Must be Base64 encoded. Restricted to 65535 bytes.
Note
The null
value allowed in Nova legacy v2 API, but due to the strict
input validation, it isn’t allowed in Nova v2.1 API.
Trait Implementations§
Source§impl<'a> Clone for ServerBuilder<'a>
impl<'a> Clone for ServerBuilder<'a>
Source§fn clone(&self) -> ServerBuilder<'a>
fn clone(&self) -> ServerBuilder<'a>
1.0.0 · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source
. Read moreAuto Trait Implementations§
impl<'a> Freeze for ServerBuilder<'a>
impl<'a> RefUnwindSafe for ServerBuilder<'a>
impl<'a> Send for ServerBuilder<'a>
impl<'a> Sync for ServerBuilder<'a>
impl<'a> Unpin for ServerBuilder<'a>
impl<'a> UnwindSafe for ServerBuilder<'a>
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<T> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<T> IntoEither for T
impl<T> IntoEither for T
Source§fn into_either(self, into_left: bool) -> Either<Self, Self>
fn into_either(self, into_left: bool) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left
is true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read moreSource§fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
fn into_either_with<F>(self, into_left: F) -> Either<Self, Self>
self
into a Left
variant of Either<Self, Self>
if into_left(&self)
returns true
.
Converts self
into a Right
variant of Either<Self, Self>
otherwise. Read more