Skip to main content

Node

Struct Node 

Source
#[non_exhaustive]
pub struct Node {
Show 25 fields pub name: String, pub description: String, pub accelerator_type: String, pub state: State, pub health_description: String, pub runtime_version: String, pub network_config: Option<NetworkConfig>, pub network_configs: Vec<NetworkConfig>, pub cidr_block: String, pub service_account: Option<ServiceAccount>, pub create_time: Option<Timestamp>, pub scheduling_config: Option<SchedulingConfig>, pub network_endpoints: Vec<NetworkEndpoint>, pub health: Health, pub labels: HashMap<String, String>, pub metadata: HashMap<String, String>, pub tags: Vec<String>, pub id: i64, pub data_disks: Vec<AttachedDisk>, pub api_version: ApiVersion, pub symptoms: Vec<Symptom>, pub shielded_instance_config: Option<ShieldedInstanceConfig>, pub accelerator_config: Option<AcceleratorConfig>, pub queued_resource: String, pub multislice_node: bool, /* private fields */
}
Expand description

A TPU instance.

Fields (Non-exhaustive)§

This struct is marked as non-exhaustive
Non-exhaustive structs could have additional fields added in future. Therefore, non-exhaustive structs cannot be constructed in external crates using the traditional Struct { .. } syntax; cannot be matched against without a wildcard ..; and struct update syntax will not work.
§name: String

Output only. Immutable. The name of the TPU.

§description: String

The user-supplied description of the TPU. Maximum of 512 characters.

§accelerator_type: String

Optional. The type of hardware accelerators associated with this node.

§state: State

Output only. The current state for the TPU Node.

§health_description: String

Output only. If this field is populated, it contains a description of why the TPU Node is unhealthy.

§runtime_version: String

Required. The runtime version running in the Node.

§network_config: Option<NetworkConfig>

Network configurations for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned.

§network_configs: Vec<NetworkConfig>

Optional. Repeated network configurations for the TPU node. This field is used to specify multiple networks configs for the TPU node. network_config and network_configs are mutually exclusive, you can only specify one of them. If both are specified, an error will be returned.

§cidr_block: String

The CIDR block that the TPU node will use when selecting an IP address. This CIDR block must be a /29 block; the Compute Engine networks API forbids a smaller block, and using a larger block would be wasteful (a node can only consume one IP address). Errors will occur if the CIDR block has already been used for a currently existing TPU node, the CIDR block conflicts with any subnetworks in the user’s provided network, or the provided network is peered with another network that is using that CIDR block.

§service_account: Option<ServiceAccount>

The Google Cloud Platform Service Account to be used by the TPU node VMs. If None is specified, the default compute service account will be used.

§create_time: Option<Timestamp>

Output only. The time when the node was created.

§scheduling_config: Option<SchedulingConfig>

The scheduling options for this node.

§network_endpoints: Vec<NetworkEndpoint>

Output only. The network endpoints where TPU workers can be accessed and sent work. It is recommended that runtime clients of the node reach out to the 0th entry in this map first.

§health: Health

The health status of the TPU node.

§labels: HashMap<String, String>

Resource labels to represent user-provided metadata.

§metadata: HashMap<String, String>

Custom metadata to apply to the TPU Node. Can set startup-script and shutdown-script

§tags: Vec<String>

Tags to apply to the TPU Node. Tags are used to identify valid sources or targets for network firewalls.

§id: i64

Output only. The unique identifier for the TPU Node.

§data_disks: Vec<AttachedDisk>

The additional data disks for the Node.

§api_version: ApiVersion

Output only. The API version that created this Node.

§symptoms: Vec<Symptom>

Output only. The Symptoms that have occurred to the TPU Node.

§shielded_instance_config: Option<ShieldedInstanceConfig>

Shielded Instance options.

§accelerator_config: Option<AcceleratorConfig>

The AccleratorConfig for the TPU Node.

§queued_resource: String

Output only. The qualified name of the QueuedResource that requested this Node.

§multislice_node: bool

Output only. Whether the Node belongs to a Multislice group.

Implementations§

Source§

impl Node

Source

pub fn new() -> Self

Source

pub fn set_name<T: Into<String>>(self, v: T) -> Self

Sets the value of name.

§Example
let x = Node::new().set_name("example");
Source

pub fn set_description<T: Into<String>>(self, v: T) -> Self

Sets the value of description.

§Example
let x = Node::new().set_description("example");
Source

pub fn set_accelerator_type<T: Into<String>>(self, v: T) -> Self

Sets the value of accelerator_type.

§Example
let x = Node::new().set_accelerator_type("example");
Source

pub fn set_state<T: Into<State>>(self, v: T) -> Self

Sets the value of state.

§Example
use google_cloud_tpu_v2::model::node::State;
let x0 = Node::new().set_state(State::Creating);
let x1 = Node::new().set_state(State::Ready);
let x2 = Node::new().set_state(State::Restarting);
Source

pub fn set_health_description<T: Into<String>>(self, v: T) -> Self

Sets the value of health_description.

§Example
let x = Node::new().set_health_description("example");
Source

pub fn set_runtime_version<T: Into<String>>(self, v: T) -> Self

Sets the value of runtime_version.

§Example
let x = Node::new().set_runtime_version("example");
Source

pub fn set_network_config<T>(self, v: T) -> Self
where T: Into<NetworkConfig>,

Sets the value of network_config.

§Example
use google_cloud_tpu_v2::model::NetworkConfig;
let x = Node::new().set_network_config(NetworkConfig::default()/* use setters */);
Source

pub fn set_or_clear_network_config<T>(self, v: Option<T>) -> Self
where T: Into<NetworkConfig>,

Sets or clears the value of network_config.

§Example
use google_cloud_tpu_v2::model::NetworkConfig;
let x = Node::new().set_or_clear_network_config(Some(NetworkConfig::default()/* use setters */));
let x = Node::new().set_or_clear_network_config(None::<NetworkConfig>);
Source

pub fn set_network_configs<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<NetworkConfig>,

Sets the value of network_configs.

§Example
use google_cloud_tpu_v2::model::NetworkConfig;
let x = Node::new()
    .set_network_configs([
        NetworkConfig::default()/* use setters */,
        NetworkConfig::default()/* use (different) setters */,
    ]);
Source

pub fn set_cidr_block<T: Into<String>>(self, v: T) -> Self

Sets the value of cidr_block.

§Example
let x = Node::new().set_cidr_block("example");
Source

pub fn set_service_account<T>(self, v: T) -> Self
where T: Into<ServiceAccount>,

Sets the value of service_account.

§Example
use google_cloud_tpu_v2::model::ServiceAccount;
let x = Node::new().set_service_account(ServiceAccount::default()/* use setters */);
Source

pub fn set_or_clear_service_account<T>(self, v: Option<T>) -> Self
where T: Into<ServiceAccount>,

Sets or clears the value of service_account.

§Example
use google_cloud_tpu_v2::model::ServiceAccount;
let x = Node::new().set_or_clear_service_account(Some(ServiceAccount::default()/* use setters */));
let x = Node::new().set_or_clear_service_account(None::<ServiceAccount>);
Source

pub fn set_create_time<T>(self, v: T) -> Self
where T: Into<Timestamp>,

Sets the value of create_time.

§Example
use wkt::Timestamp;
let x = Node::new().set_create_time(Timestamp::default()/* use setters */);
Source

pub fn set_or_clear_create_time<T>(self, v: Option<T>) -> Self
where T: Into<Timestamp>,

Sets or clears the value of create_time.

§Example
use wkt::Timestamp;
let x = Node::new().set_or_clear_create_time(Some(Timestamp::default()/* use setters */));
let x = Node::new().set_or_clear_create_time(None::<Timestamp>);
Source

pub fn set_scheduling_config<T>(self, v: T) -> Self

Sets the value of scheduling_config.

§Example
use google_cloud_tpu_v2::model::SchedulingConfig;
let x = Node::new().set_scheduling_config(SchedulingConfig::default()/* use setters */);
Source

pub fn set_or_clear_scheduling_config<T>(self, v: Option<T>) -> Self

Sets or clears the value of scheduling_config.

§Example
use google_cloud_tpu_v2::model::SchedulingConfig;
let x = Node::new().set_or_clear_scheduling_config(Some(SchedulingConfig::default()/* use setters */));
let x = Node::new().set_or_clear_scheduling_config(None::<SchedulingConfig>);
Source

pub fn set_network_endpoints<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<NetworkEndpoint>,

Sets the value of network_endpoints.

§Example
use google_cloud_tpu_v2::model::NetworkEndpoint;
let x = Node::new()
    .set_network_endpoints([
        NetworkEndpoint::default()/* use setters */,
        NetworkEndpoint::default()/* use (different) setters */,
    ]);
Source

pub fn set_health<T: Into<Health>>(self, v: T) -> Self

Sets the value of health.

§Example
use google_cloud_tpu_v2::model::node::Health;
let x0 = Node::new().set_health(Health::Healthy);
let x1 = Node::new().set_health(Health::Timeout);
let x2 = Node::new().set_health(Health::UnhealthyTensorflow);
Source

pub fn set_labels<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of labels.

§Example
let x = Node::new().set_labels([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_metadata<T, K, V>(self, v: T) -> Self
where T: IntoIterator<Item = (K, V)>, K: Into<String>, V: Into<String>,

Sets the value of metadata.

§Example
let x = Node::new().set_metadata([
    ("key0", "abc"),
    ("key1", "xyz"),
]);
Source

pub fn set_tags<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<String>,

Sets the value of tags.

§Example
let x = Node::new().set_tags(["a", "b", "c"]);
Source

pub fn set_id<T: Into<i64>>(self, v: T) -> Self

Sets the value of id.

§Example
let x = Node::new().set_id(42);
Source

pub fn set_data_disks<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<AttachedDisk>,

Sets the value of data_disks.

§Example
use google_cloud_tpu_v2::model::AttachedDisk;
let x = Node::new()
    .set_data_disks([
        AttachedDisk::default()/* use setters */,
        AttachedDisk::default()/* use (different) setters */,
    ]);
Source

pub fn set_api_version<T: Into<ApiVersion>>(self, v: T) -> Self

Sets the value of api_version.

§Example
use google_cloud_tpu_v2::model::node::ApiVersion;
let x0 = Node::new().set_api_version(ApiVersion::V1Alpha1);
let x1 = Node::new().set_api_version(ApiVersion::V1);
let x2 = Node::new().set_api_version(ApiVersion::V2Alpha1);
Source

pub fn set_symptoms<T, V>(self, v: T) -> Self
where T: IntoIterator<Item = V>, V: Into<Symptom>,

Sets the value of symptoms.

§Example
use google_cloud_tpu_v2::model::Symptom;
let x = Node::new()
    .set_symptoms([
        Symptom::default()/* use setters */,
        Symptom::default()/* use (different) setters */,
    ]);
Source

pub fn set_shielded_instance_config<T>(self, v: T) -> Self

Sets the value of shielded_instance_config.

§Example
use google_cloud_tpu_v2::model::ShieldedInstanceConfig;
let x = Node::new().set_shielded_instance_config(ShieldedInstanceConfig::default()/* use setters */);
Source

pub fn set_or_clear_shielded_instance_config<T>(self, v: Option<T>) -> Self

Sets or clears the value of shielded_instance_config.

§Example
use google_cloud_tpu_v2::model::ShieldedInstanceConfig;
let x = Node::new().set_or_clear_shielded_instance_config(Some(ShieldedInstanceConfig::default()/* use setters */));
let x = Node::new().set_or_clear_shielded_instance_config(None::<ShieldedInstanceConfig>);
Source

pub fn set_accelerator_config<T>(self, v: T) -> Self

Sets the value of accelerator_config.

§Example
use google_cloud_tpu_v2::model::AcceleratorConfig;
let x = Node::new().set_accelerator_config(AcceleratorConfig::default()/* use setters */);
Source

pub fn set_or_clear_accelerator_config<T>(self, v: Option<T>) -> Self

Sets or clears the value of accelerator_config.

§Example
use google_cloud_tpu_v2::model::AcceleratorConfig;
let x = Node::new().set_or_clear_accelerator_config(Some(AcceleratorConfig::default()/* use setters */));
let x = Node::new().set_or_clear_accelerator_config(None::<AcceleratorConfig>);
Source

pub fn set_queued_resource<T: Into<String>>(self, v: T) -> Self

Sets the value of queued_resource.

§Example
let x = Node::new().set_queued_resource("example");
Source

pub fn set_multislice_node<T: Into<bool>>(self, v: T) -> Self

Sets the value of multislice_node.

§Example
let x = Node::new().set_multislice_node(true);

Trait Implementations§

Source§

impl Clone for Node

Source§

fn clone(&self) -> Node

Returns a duplicate of the value. Read more
1.0.0 · Source§

fn clone_from(&mut self, source: &Self)

Performs copy-assignment from source. Read more
Source§

impl Debug for Node

Source§

fn fmt(&self, f: &mut Formatter<'_>) -> Result

Formats the value using the given formatter. Read more
Source§

impl Default for Node

Source§

fn default() -> Node

Returns the “default value” for a type. Read more
Source§

impl Message for Node

Source§

fn typename() -> &'static str

The typename of this message.
Source§

impl PartialEq for Node

Source§

fn eq(&self, other: &Node) -> bool

Tests for self and other values to be equal, and is used by ==.
1.0.0 · Source§

fn ne(&self, other: &Rhs) -> bool

Tests for !=. The default implementation is almost always sufficient, and should not be overridden without very good reason.
Source§

impl StructuralPartialEq for Node

Auto Trait Implementations§

§

impl Freeze for Node

§

impl RefUnwindSafe for Node

§

impl Send for Node

§

impl Sync for Node

§

impl Unpin for Node

§

impl UnsafeUnpin for Node

§

impl UnwindSafe for Node

Blanket Implementations§

Source§

impl<T> Any for T
where T: 'static + ?Sized,

Source§

fn type_id(&self) -> TypeId

Gets the TypeId of self. Read more
Source§

impl<T> Borrow<T> for T
where T: ?Sized,

Source§

fn borrow(&self) -> &T

Immutably borrows from an owned value. Read more
Source§

impl<T> BorrowMut<T> for T
where T: ?Sized,

Source§

fn borrow_mut(&mut self) -> &mut T

Mutably borrows from an owned value. Read more
Source§

impl<T> CloneToUninit for T
where T: Clone,

Source§

unsafe fn clone_to_uninit(&self, dest: *mut u8)

🔬This is a nightly-only experimental API. (clone_to_uninit)
Performs copy-assignment from self to dest. Read more
Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

Source§

impl<T> FutureExt for T

Source§

fn with_context(self, otel_cx: Context) -> WithContext<Self>

Attaches the provided Context to this type, returning a WithContext wrapper. Read more
Source§

fn with_current_context(self) -> WithContext<Self>

Attaches the current Context to this type, returning a WithContext wrapper. Read more
Source§

impl<T> Instrument for T

Source§

fn instrument(self, span: Span) -> Instrumented<Self>

Instruments this type with the provided Span, returning an Instrumented wrapper. Read more
Source§

fn in_current_span(self) -> Instrumented<Self>

Instruments this type with the current Span, returning an Instrumented wrapper. Read more
Source§

impl<T, U> Into<U> for T
where U: From<T>,

Source§

fn into(self) -> U

Calls U::from(self).

That is, this conversion is whatever the implementation of From<T> for U chooses to do.

Source§

impl<T> PolicyExt for T
where T: ?Sized,

Source§

fn and<P, B, E>(self, other: P) -> And<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow only if self and other return Action::Follow. Read more
Source§

fn or<P, B, E>(self, other: P) -> Or<T, P>
where T: Policy<B, E>, P: Policy<B, E>,

Create a new Policy that returns Action::Follow if either self or other returns Action::Follow. Read more
Source§

impl<T> Same for T

Source§

type Output = T

Should always be Self
Source§

impl<T> ToOwned for T
where T: Clone,

Source§

type Owned = T

The resulting type after obtaining ownership.
Source§

fn to_owned(&self) -> T

Creates owned data from borrowed data, usually by cloning. Read more
Source§

fn clone_into(&self, target: &mut T)

Uses borrowed data to replace owned data, usually by cloning. Read more
Source§

impl<T, U> TryFrom<U> for T
where U: Into<T>,

Source§

type Error = Infallible

The type returned in the event of a conversion error.
Source§

fn try_from(value: U) -> Result<T, <T as TryFrom<U>>::Error>

Performs the conversion.
Source§

impl<T, U> TryInto<U> for T
where U: TryFrom<T>,

Source§

type Error = <U as TryFrom<T>>::Error

The type returned in the event of a conversion error.
Source§

fn try_into(self) -> Result<U, <U as TryFrom<T>>::Error>

Performs the conversion.
Source§

impl<V, T> VZip<V> for T
where V: MultiLane<T>,

Source§

fn vzip(self) -> V

Source§

impl<T> WithSubscriber for T

Source§

fn with_subscriber<S>(self, subscriber: S) -> WithDispatch<Self>
where S: Into<Dispatch>,

Attaches the provided Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

fn with_current_subscriber(self) -> WithDispatch<Self>

Attaches the current default Subscriber to this type, returning a WithDispatch wrapper. Read more
Source§

impl<T> DeserializeOwned for T
where T: for<'de> Deserialize<'de>,