pub struct JitRunnerRequest { /* private fields */ }Expand description
One generate-jitconfig request, before a scope is chosen.
The same value registers at repository scope or organization scope: v1
established that the two forms take the identical body and answer with the
identical shape, so the scope is a ScaleTarget passed to
JitGateway::generate_jit_config rather than a property of the request.
Implementations§
Source§impl JitRunnerRequest
impl JitRunnerRequest
Sourcepub fn new(
name: impl Into<String>,
runner_group_id: u64,
labels: impl IntoIterator<Item = impl Into<String>>,
) -> Self
pub fn new( name: impl Into<String>, runner_group_id: u64, labels: impl IntoIterator<Item = impl Into<String>>, ) -> Self
A registration for name in runner_group_id, carrying labels.
runner_group_id is a required argument and not an Option on purpose:
v1 proved there is no server-side default and that omitting the field
is a 422, so the only way to send a request without one is not to be
able to build it.
§An empty label set is not rejected here
GitHub answers labels: [] with 422 Invalid property /labels: 1 item required; only 0 were supplied, and that message is more useful to an
operator than anything this constructor could say — it names the property
and the requirement. The ordinary path cannot produce one anyway:
Self::for_policy takes a RoutingLabels, which is non-empty by
construction because its host label has no removal path.
Sourcepub fn for_policy(
name: impl Into<String>,
runner_group_id: u64,
labels: &RoutingLabels,
) -> Self
pub fn for_policy( name: impl Into<String>, runner_group_id: u64, labels: &RoutingLabels, ) -> Self
A registration carrying exactly the policy’s routing labels.
This is the constructor the product uses.
RoutingLabels::as_registration_labels is documented as “c4 sends
exactly this”, and exactly is the operative word: v1 established that
no labels are added implicitly, so a label the operator expects to be
matchable has to be in this array or it does not exist on the runner.
Sourcepub fn with_work_folder(self, work_folder: impl Into<String>) -> Self
pub fn with_work_folder(self, work_folder: impl Into<String>) -> Self
Override the runner’s working directory.
pub fn name(&self) -> &str
pub const fn runner_group_id(&self) -> u64
pub fn labels(&self) -> &[String]
pub fn work_folder(&self) -> &str
Trait Implementations§
Source§impl Clone for JitRunnerRequest
impl Clone for JitRunnerRequest
Source§fn clone(&self) -> JitRunnerRequest
fn clone(&self) -> JitRunnerRequest
1.0.0 (const: unstable) · Source§fn clone_from(&mut self, source: &Self)
fn clone_from(&mut self, source: &Self)
source. Read moreSource§impl Debug for JitRunnerRequest
impl Debug for JitRunnerRequest
impl Eq for JitRunnerRequest
Source§impl PartialEq for JitRunnerRequest
impl PartialEq for JitRunnerRequest
impl StructuralPartialEq for JitRunnerRequest
Auto Trait Implementations§
impl Freeze for JitRunnerRequest
impl RefUnwindSafe for JitRunnerRequest
impl Send for JitRunnerRequest
impl Sync for JitRunnerRequest
impl Unpin for JitRunnerRequest
impl UnsafeUnpin for JitRunnerRequest
impl UnwindSafe for JitRunnerRequest
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<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
key and return true if they are equal.