Struct Jenkins

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

Client struct with the methods to query Jenkins

Implementations§

Source§

impl Jenkins

Source

pub fn get_object_as<Q, T>(&self, object: Path<'_>, parameters: Q) -> Result<T>
where Q: Into<Option<AdvancedQuery>>, for<'de> T: Deserialize<'de>,

Get a Path from Jenkins, specifying the depth or tree parameters

§Example
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
struct LastBuild {
    number: u32,
    duration: u32,
    result: String,
}
#[derive(Deserialize)]
#[serde(rename_all = "camelCase")]
struct LastBuildOfJob {
    display_name: String,
    last_build: LastBuild,
}

let _: LastBuildOfJob = jenkins.get_object_as(
    jenkins_api::client::Path::Job {
        name: "job name",
        configuration: None,
    },
    jenkins_api::client::TreeBuilder::new()
        .with_field("displayName")
        .with_field(
            jenkins_api::client::TreeBuilder::object("lastBuild")
                .with_subfield("number")
                .with_subfield("duration")
                .with_subfield("result"),
        )
        .build(),
)?;
Source§

impl Jenkins

Source

pub fn get_build<'a, J, B>( &self, job_name: J, build_number: B, ) -> Result<CommonBuild>
where J: Into<JobName<'a>>, B: Into<BuildNumber>,

Get a build from a job_name and build_number

Source§

impl Jenkins

Source

pub fn get_home(&self) -> Result<Home>

Get Jenkins Home

Source§

impl Jenkins

Source

pub fn get_job<'a, J>(&self, job_name: J) -> Result<CommonJob>
where J: Into<JobName<'a>>,

Get a Job from it’s job_name

Source

pub fn build_job<'a, J>(&self, job_name: J) -> Result<ShortQueueItem>
where J: Into<JobName<'a>>,

Build a Job from it’s job_name

Source

pub fn job_builder<'a, 'b, 'c, 'd>( &'b self, job_name: &'a str, ) -> Result<JobBuilder<'a, 'b, 'c, 'd>>

Create a JobBuilder to setup a build of a Job from it’s job_name

Source

pub fn poll_scm_job<'a, J>(&self, job_name: J) -> Result<()>
where J: Into<JobName<'a>>,

Poll SCM of a Job from it’s job_name

Source§

impl Jenkins

Source

pub fn get_nodes(&self) -> Result<ComputerSet>

Get a ComputerSet

Source

pub fn get_node<'a, C>(&self, computer_name: C) -> Result<CommonComputer>
where C: Into<ComputerName<'a>>,

Get a Computer

Source

pub fn get_master_node(&self) -> Result<MasterComputer>

Get the master Computer

Source§

impl Jenkins

Source

pub fn get_queue(&self) -> Result<Queue>

Get the Jenkins items queue

Source

pub fn get_queue_item(&self, id: i32) -> Result<QueueItem>

Get a queue item from it’s ID

Source§

impl Jenkins

Source

pub fn get_view<'a, V>(&self, view_name: V) -> Result<CommonView>
where V: Into<ViewName<'a>>,

Get a View

Source

pub fn add_job_to_view<'a, 'b, V, J>( &self, view_name: V, job_name: J, ) -> Result<()>
where V: Into<ViewName<'a>>, J: Into<JobName<'a>>,

Add the job job_name to the view view_name

Source

pub fn remove_job_from_view<'a, 'b, V, J>( &self, view_name: V, job_name: J, ) -> Result<()>
where V: Into<ViewName<'a>>, J: Into<JobName<'a>>,

Remove the job job_name from the view view_name

Trait Implementations§

Source§

impl Debug for Jenkins

Source§

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

Formats the value using the given formatter. Read more

Auto Trait Implementations§

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> 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> 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, 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
Source§

impl<T> ErasedDestructor for T
where T: 'static,