graph LR
Nomad_Client_Core["Nomad Client Core"]
API_Request_Layer["API Request Layer"]
Workload_Orchestration["Workload Orchestration"]
Cluster_Management["Cluster Management"]
Security_Configuration["Security & Configuration"]
Event_Stream["Event Stream"]
Exception_Handling["Exception Handling"]
Nomad_Client_Core -- "Initializes" --> Workload_Orchestration
Nomad_Client_Core -- "Initializes" --> Cluster_Management
Nomad_Client_Core -- "Initializes" --> Security_Configuration
Nomad_Client_Core -- "Initializes" --> Event_Stream
Workload_Orchestration -- "Utilizes" --> API_Request_Layer
Cluster_Management -- "Utilizes" --> API_Request_Layer
Security_Configuration -- "Utilizes" --> API_Request_Layer
Event_Stream -- "Utilizes" --> API_Request_Layer
API_Request_Layer -- "Raises" --> Exception_Handling
Workload_Orchestration -- "Raises" --> Exception_Handling
Cluster_Management -- "Raises" --> Exception_Handling
Security_Configuration -- "Raises" --> Exception_Handling
Event_Stream -- "Raises" --> Exception_Handling
click Nomad_Client_Core href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Nomad Client Core.md" "Details"
click API_Request_Layer href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/API Request Layer.md" "Details"
click Workload_Orchestration href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Workload Orchestration.md" "Details"
click Cluster_Management href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Cluster Management.md" "Details"
click Security_Configuration href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Security & Configuration.md" "Details"
click Event_Stream href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Event Stream.md" "Details"
click Exception_Handling href "https://github.com/CodeBoarding/GeneratedOnBoardings/blob/main/python-nomad/Exception Handling.md" "Details"
The python-nomad library provides a comprehensive Python client for interacting with the Nomad cluster. Its architecture is designed with a clear separation of concerns, where a central client core initializes and orchestrates various API-specific modules. All interactions with the Nomad API are channeled through a dedicated request layer, which handles the underlying HTTP communication and robust error management. This design ensures modularity, maintainability, and efficient interaction with the Nomad cluster's diverse functionalities, from workload orchestration to cluster management and security configurations.
The primary entry point for the python-nomad library, responsible for initializing the connection to the Nomad cluster and providing access to all other API-specific client modules. It acts as the central interface for users to interact with the Nomad cluster.
Related Classes/Methods:
nomad.Nomad:__init__(30:60)nomad.Nomad.get_uri(62:65)
A foundational component that abstracts the complexities of making HTTP requests to the Nomad API. It handles URL construction, query parameter building, request execution, and robust error handling, serving as the underlying communication mechanism for all other API client modules.
Related Classes/Methods:
nomad.api.base.Requester:__init__(17:43)nomad.api.base.Requester:request(103:120)nomad.api.base.Requester:_request(122:220)nomad.api.base.Requester._url_builder(77:84)
Manages the lifecycle of applications and services within Nomad, encompassing operations related to jobs (definition, registration, evaluation), deployments (tracking, promotion, failure), and allocations (listing, stopping, client-side file system interactions and statistics).
Related Classes/Methods:
nomad.api.job.Job(9:363)nomad.api.jobs.Jobs(9:127)nomad.api.deployment.Deployment(8:172)nomad.api.deployments.Deployments(8:78)nomad.api.allocation.Allocation(8:73)nomad.api.allocations.Allocations(8:83)nomad.api.client.Client(7:32)nomad.api.evaluation.Evaluation(8:74)nomad.api.evaluations.Evaluations(8:75)
Provides functionalities for monitoring and controlling the Nomad cluster's infrastructure. This includes managing agents and nodes, retrieving cluster status and metrics, performing operator-level actions, and interacting with multi-region deployments.
Related Classes/Methods:
nomad.api.agent.Agent(6:98)nomad.api.node.Node(9:193)nomad.api.nodes.Nodes(10:95)nomad.api.operator.Operator(6:64)nomad.api.system.System(6:52)nomad.api.status.Status(8:27)nomad.api.metrics.Metrics(6:42)nomad.api.regions.Regions(8:68)
Handles access control, organizational structures, and dynamic data within Nomad. This includes managing ACL tokens and policies, creating and managing namespaces, interacting with Nomad variables, and utilities for scaling policies, search, Sentinel policies, and job validation.
Related Classes/Methods:
nomad.api.acl.Acl(6:194)nomad.api.namespace.Namespace(8:107)nomad.api.namespaces.Namespaces(8:75)nomad.api.variable.Variable(8:111)nomad.api.variables.Variables(6:66)nomad.api.scaling.Scaling(8:74)nomad.api.search.Search(8:98)nomad.api.sentinel.Sentinel(6:98)nomad.api.validate.Validate(6:44)
Dedicated component for establishing and managing real-time event streams from the Nomad server, allowing for continuous monitoring of cluster activities and changes.
Related Classes/Methods:
A collection of custom exception classes designed to provide specific error information when interactions with the Nomad API fail, enabling more granular error management and debugging within the client library.
Related Classes/Methods:
nomad.api.exceptions.BaseNomadException(6:16)nomad.api.exceptions.InvalidParameters(35:36)nomad.api.exceptions.BadRequestNomadException(27:28)nomad.api.exceptions.URLNotAuthorizedNomadException(23:24)nomad.api.exceptions.URLNotFoundNomadException(19:20)nomad.api.exceptions.VariableConflict(31:32)nomad.api.exceptions.TimeoutNomadException(39:40)