pub struct Pyo3Node(pub Node);Expand description
Represents an individual Docker Swarm node.
Swarm mode must be enabled for these operations to work.
Tuple Fields§
§0: NodeImplementations§
Source§impl Pyo3Node
impl Pyo3Node
pub fn new(docker: Pyo3Docker, id: &str) -> Self
Sourcepub fn inspect(&self) -> PyResult<Py<PyAny>>
pub fn inspect(&self) -> PyResult<Py<PyAny>>
Inspect the node to get detailed information.
Returns: dict: Detailed node information including status, description, spec, etc.
Raises: SystemError: If the operation fails
Sourcepub fn delete(&self) -> PyResult<()>
pub fn delete(&self) -> PyResult<()>
Delete the node from the swarm.
Returns: None
Raises: SystemError: If the node cannot be deleted
Sourcepub fn force_delete(&self) -> PyResult<()>
pub fn force_delete(&self) -> PyResult<()>
Force delete the node from the swarm.
Returns: None
Raises: SystemError: If the node cannot be deleted
Sourcepub fn update(
&self,
version: &str,
name: Option<&str>,
role: Option<&str>,
availability: Option<&str>,
labels: Option<&Bound<'_, PyDict>>,
) -> PyResult<()>
pub fn update( &self, version: &str, name: Option<&str>, role: Option<&str>, availability: Option<&str>, labels: Option<&Bound<'_, PyDict>>, ) -> PyResult<()>
Update the node configuration.
Args: version: Node version string (required, use inspect() to get current version) name: Node name role: Node role (“worker” or “manager”) availability: Node availability (“active”, “pause”, or “drain”) labels: Node labels as dict (e.g., {“env”: “prod”})
Returns: None
Raises: SystemError: If the update fails
Trait Implementations§
Source§impl<'py> IntoPyObject<'py> for Pyo3Node
impl<'py> IntoPyObject<'py> for Pyo3Node
Source§type Output = Bound<'py, <Pyo3Node as IntoPyObject<'py>>::Target>
type Output = Bound<'py, <Pyo3Node as IntoPyObject<'py>>::Target>
Source§fn into_pyobject(
self,
py: Python<'py>,
) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
fn into_pyobject( self, py: Python<'py>, ) -> Result<<Self as IntoPyObject<'_>>::Output, <Self as IntoPyObject<'_>>::Error>
Source§impl PyClassImpl for Pyo3Node
impl PyClassImpl for Pyo3Node
Source§const IS_BASETYPE: bool = false
const IS_BASETYPE: bool = false
Source§const IS_SUBCLASS: bool = false
const IS_SUBCLASS: bool = false
Source§const IS_MAPPING: bool = false
const IS_MAPPING: bool = false
Source§const IS_SEQUENCE: bool = false
const IS_SEQUENCE: bool = false
Source§const IS_IMMUTABLE_TYPE: bool = false
const IS_IMMUTABLE_TYPE: bool = false
Source§const RAW_DOC: &'static CStr = /// Represents an individual Docker Swarm node.
///
/// Swarm mode must be enabled for these operations to work.
const RAW_DOC: &'static CStr = /// Represents an individual Docker Swarm node. /// /// Swarm mode must be enabled for these operations to work.
Source§const DOC: &'static CStr
const DOC: &'static CStr
text_signature if a constructor is defined. Read moreSource§type ThreadChecker = SendablePyClass<Pyo3Node>
type ThreadChecker = SendablePyClass<Pyo3Node>
Source§type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
type PyClassMutability = <<PyAny as PyClassBaseType>::PyClassMutability as PyClassMutability>::MutableChild
Source§type BaseNativeType = PyAny
type BaseNativeType = PyAny
PyAny by default, and when you declare
#[pyclass(extends=PyDict)], it’s PyDict.fn items_iter() -> PyClassItemsIter
fn lazy_type_object() -> &'static LazyTypeObject<Self>
fn dict_offset() -> Option<isize>
fn weaklist_offset() -> Option<isize>
Source§impl PyClassNewTextSignature for Pyo3Node
impl PyClassNewTextSignature for Pyo3Node
const TEXT_SIGNATURE: &'static str = "(docker, id)"
Source§impl PyMethods<Pyo3Node> for PyClassImplCollector<Pyo3Node>
impl PyMethods<Pyo3Node> for PyClassImplCollector<Pyo3Node>
fn py_methods(self) -> &'static PyClassItems
Source§impl PyTypeInfo for Pyo3Node
impl PyTypeInfo for Pyo3Node
Source§fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
fn type_object_raw(py: Python<'_>) -> *mut PyTypeObject
Source§fn type_object(py: Python<'_>) -> Bound<'_, PyType>
fn type_object(py: Python<'_>) -> Bound<'_, PyType>
impl DerefToPyAny for Pyo3Node
impl ExtractPyClassWithClone for Pyo3Node
Auto Trait Implementations§
impl Freeze for Pyo3Node
impl !RefUnwindSafe for Pyo3Node
impl Send for Pyo3Node
impl Sync for Pyo3Node
impl Unpin for Pyo3Node
impl !UnwindSafe for Pyo3Node
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> Instrument for T
impl<T> Instrument for T
Source§fn instrument(self, span: Span) -> Instrumented<Self>
fn instrument(self, span: Span) -> Instrumented<Self>
Source§fn in_current_span(self) -> Instrumented<Self>
fn in_current_span(self) -> Instrumented<Self>
Source§impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
impl<'py, T> IntoPyObjectExt<'py> for Twhere
T: IntoPyObject<'py>,
Source§fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
fn into_bound_py_any(self, py: Python<'py>) -> Result<Bound<'py, PyAny>, PyErr>
self into an owned Python object, dropping type information.