SandboxApi

Struct SandboxApi 

Source
pub struct SandboxApi<'a> { /* private fields */ }
Expand description

Veracode Sandbox API operations

Implementations§

Source§

impl<'a> SandboxApi<'a>

Source

pub fn new(client: &'a VeracodeClient) -> Self

Create a new SandboxApi instance

Source

pub async fn list_sandboxes( &self, application_guid: &str, params: Option<SandboxListParams>, ) -> Result<Vec<Sandbox>, SandboxError>

List all sandboxes for a given application

§Arguments
  • application_guid - The GUID of the application
  • params - Optional query parameters for filtering
§Returns

A Result containing a list of sandboxes or an error.

Source

pub async fn get_sandbox( &self, application_guid: &str, sandbox_guid: &str, ) -> Result<Sandbox, SandboxError>

Get a specific sandbox by GUID

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox
§Returns

A Result containing the sandbox or an error.

Source

pub async fn create_sandbox( &self, application_guid: &str, request: CreateSandboxRequest, ) -> Result<Sandbox, SandboxError>

Create a new sandbox

§Arguments
  • application_guid - The GUID of the application
  • request - The sandbox creation request
§Returns

A Result containing the created sandbox or an error.

Source

pub async fn update_sandbox( &self, application_guid: &str, sandbox_guid: &str, request: UpdateSandboxRequest, ) -> Result<Sandbox, SandboxError>

Update an existing sandbox

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox to update
  • request - The sandbox update request
§Returns

A Result containing the updated sandbox or an error.

Source

pub async fn delete_sandbox( &self, application_guid: &str, sandbox_guid: &str, ) -> Result<(), SandboxError>

Delete a sandbox

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox to delete
§Returns

A Result indicating success or failure.

Source

pub async fn promote_sandbox_scan( &self, application_guid: &str, sandbox_guid: &str, delete_on_promote: bool, ) -> Result<(), SandboxError>

Promote a sandbox scan to the policy sandbox

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox to promote
  • delete_on_promote - Whether to delete the sandbox after promotion
§Returns

A Result indicating success or failure.

Source

pub async fn get_sandbox_scans( &self, application_guid: &str, sandbox_guid: &str, ) -> Result<Vec<SandboxScan>, SandboxError>

Get sandbox scan information

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox
§Returns

A Result containing a list of scans or an error.

Source

pub async fn sandbox_exists( &self, application_guid: &str, sandbox_guid: &str, ) -> Result<bool, SandboxError>

Check if a sandbox exists

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox
§Returns

A Result containing a boolean indicating if the sandbox exists.

Source

pub async fn get_sandbox_by_name( &self, application_guid: &str, name: &str, ) -> Result<Option<Sandbox>, SandboxError>

Get sandbox by name

§Arguments
  • application_guid - The GUID of the application
  • name - The name of the sandbox to find
§Returns

A Result containing the sandbox if found, or None if not found.

Source§

impl<'a> SandboxApi<'a>

Convenience methods for common sandbox operations

Source

pub async fn create_simple_sandbox( &self, application_guid: &str, name: &str, ) -> Result<Sandbox, SandboxError>

Create a simple sandbox with just a name

§Arguments
  • application_guid - The GUID of the application
  • name - The name of the sandbox
§Returns

A Result containing the created sandbox or an error.

Source

pub async fn create_auto_recreate_sandbox( &self, application_guid: &str, name: &str, description: Option<String>, ) -> Result<Sandbox, SandboxError>

Create a sandbox with auto-recreate enabled

§Arguments
  • application_guid - The GUID of the application
  • name - The name of the sandbox
  • description - Optional description
§Returns

A Result containing the created sandbox or an error.

Source

pub async fn update_sandbox_name( &self, application_guid: &str, sandbox_guid: &str, new_name: &str, ) -> Result<Sandbox, SandboxError>

Update sandbox name

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The GUID of the sandbox
  • new_name - The new name for the sandbox
§Returns

A Result containing the updated sandbox or an error.

Source

pub async fn count_sandboxes( &self, application_guid: &str, ) -> Result<usize, SandboxError>

Count sandboxes for an application

§Arguments
  • application_guid - The GUID of the application
§Returns

A Result containing the count of sandboxes or an error.

Source

pub async fn get_sandbox_id_from_guid( &self, application_guid: &str, sandbox_guid: &str, ) -> Result<String, SandboxError>

Get numeric sandbox_id from sandbox GUID.

This is needed for XML API operations that require numeric IDs.

§Arguments
  • application_guid - The GUID of the application
  • sandbox_guid - The sandbox GUID
§Returns

A Result containing the numeric sandbox_id as a string.

Source

pub async fn create_sandbox_if_not_exists( &self, application_guid: &str, name: &str, description: Option<String>, ) -> Result<Sandbox, SandboxError>

Create sandbox if it doesn’t exist, or return existing sandbox.

This method implements the “check and create” pattern commonly needed for automated workflows.

§Arguments
  • application_guid - The GUID of the application
  • name - The name of the sandbox
  • description - Optional description for new sandboxes
§Returns

A Result containing the sandbox (existing or newly created).

Auto Trait Implementations§

§

impl<'a> Freeze for SandboxApi<'a>

§

impl<'a> !RefUnwindSafe for SandboxApi<'a>

§

impl<'a> Send for SandboxApi<'a>

§

impl<'a> Sync for SandboxApi<'a>

§

impl<'a> Unpin for SandboxApi<'a>

§

impl<'a> !UnwindSafe for SandboxApi<'a>

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, 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, 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> ErasedDestructor for T
where T: 'static,