Struct Client

Source
pub struct Client { /* private fields */ }
Expand description

Entrypoint for interacting with the API client.

Implementations§

Source§

impl Client

Source

pub fn new<T, H>(token: T, host: H) -> Self
where T: ToString, H: ToString,

Create a new Client struct. It takes a type that can convert into an &str (String or Vec<u8> for example). As long as the function is given a valid API key your requests will work.

Source

pub fn new_from_env() -> Self

Create a new Client struct from environment variables: OXIDE_TOKEN and OXIDE_HOST.

Source

pub async fn request_raw( &self, method: Method, uri: &str, body: Option<Body>, ) -> Result<RequestBuilder>

Source

pub async fn response_raw( &self, method: Method, uri: &str, body: Option<Body>, ) -> Result<Response>

Source

pub fn disks(&self) -> Disks

Virtual disks are used to store instance-local data which includes the operating system.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn hidden(&self) -> Hidden

TODO operations that will not ship to customers.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn images(&self) -> Images

Images are read-only Virtual Disks that may be used to boot Virtual Machines.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn images_global(&self) -> ImagesGlobal

Images are read-only Virtual Disks that may be used to boot Virtual Machines. These images are scoped globally.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn instances(&self) -> Instances

Virtual machine instances are the basic unit of computation. These operations are used for provisioning, controlling, and destroying instances.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn ip_pools(&self) -> IpPools

IP Pools contain external IP addresses that can be assigned to virtual machine Instances.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn login(&self) -> Login

Authentication endpoints.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn metrics(&self) -> Metrics

Metrics provide insight into the operation of the Oxide deployment. These include telemetry on hardware and software components that can be used to understand the current state as well as to diagnose issues.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn organizations(&self) -> Organizations

Organizations represent a subset of users and projects in an Oxide deployment.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn policy(&self) -> Policy

System-wide IAM policy.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn projects(&self) -> Projects

Projects are a grouping of associated resources such as instances and disks within an organization for purposes of billing and access control.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn racks(&self) -> Racks

These operations pertain to hardware inventory and management. Racks are the unit of expansion of an Oxide deployment. Racks are in turn composed of sleds, switches, power supplies, and a cabled backplane.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn roles(&self) -> Roles

Roles are a component of Identity and Access Management (IAM) that allow a user or agent account access to additional permissions.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn routers(&self) -> Routers

Routers direct the flow of network traffic into, out of, and within a VPC via routes.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn routes(&self) -> Routes

Routes define router policy.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn sagas(&self) -> Sagas

Sagas are the abstraction used to represent multi-step operations within the Oxide deployment. These operations can be used to query saga status and report errors.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn sleds(&self) -> Sleds

This tag should be moved into hardware.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn silos(&self) -> Silos

Silos represent a logical partition of users and resources.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn snapshots(&self) -> Snapshots

Snapshots of Virtual Disks at a particular point in time.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn sshkeys(&self) -> Sshkeys

Public SSH keys for an individual user.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn subnets(&self) -> Subnets

This tag should be moved into a generic network tag.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn system(&self) -> System

Internal system information.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn updates(&self) -> Updates

This tag should be moved into a operations tag.

FROM: http://oxide.computer/docs/#xxx

Source

pub fn vpcs(&self) -> Vpcs

A Virtual Private Cloud (VPC) is an isolated network environment that should probaby be moved into a more generic networking tag.

FROM: http://oxide.computer/docs/#xxx

Trait Implementations§

Source§

impl Clone for Client

Source§

fn clone(&self) -> Client

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

Auto Trait Implementations§

§

impl Freeze for Client

§

impl !RefUnwindSafe for Client

§

impl Send for Client

§

impl Sync for Client

§

impl Unpin for Client

§

impl !UnwindSafe for Client

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> DynClone for T
where T: Clone,

Source§

fn __clone_box(&self, _: Private) -> *mut ()

Source§

impl<T> From<T> for T

Source§

fn from(t: T) -> T

Returns the argument unchanged.

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> IntoResult<T> for T

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<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