Skip to main content

zabel-elements

Overview

This is part of the Zabel platform. The zabel-elements package contains the standard elements library for Zabel.

An element is an external service such as Artifactory or Jenkins or an LDAP server that can be managed or used by Zabel.

This package provides the necessary wrappers for some elements commonly found in many workplaces, namely:

  • Actito
  • Artifactory
  • Atlassian
  • CloudBeesJenkins
  • Confluence
  • ConfluenceCloud
  • GitHub
  • GitHubCloud
  • GitLab
  • Jira
  • JiraCloud
  • Kubernetes (in alpha)
  • Okta
  • SonarQube
  • SonatypeNexus
  • SquashTM

Elements are of two kinds: Managed services, which represent services that are managed by Zabel, and Utilities, which represent services that are used by Zabel.

Managed services host project resources. They typically are the tools that project members interact with directly.

Utilities may also host project resources, but they typically are not used directly by project members. They are either references or infrastructure services necessary for the managed services to function, but otherwise not seen by project members. An LDAP server would probably be a utility, used both as a reference and as an access control tool.

In the above list, Atlassian, Kubernetes, and Okta are utilities. The other elements are managed services.

You can use this library independently of the Zabel platform, as it has no specific dependencies on it. In particular, the zabel.elements.clients module may be of interest if you want to perform some configuration tasks from your own Python code.

Contributions of new wrappers or extensions of existing wrappers are welcomed. But elements can be provided in their own packages too.

Architecture

It contains two parts:

  • The zabel.elements.clients module
  • The zabel.elements.images base classes module

There is one image per client (hence one image per element). Images are classes with a standardized constructor taking no parameters and a run() method and are how code is packaged so that it can be deployed on the Zabel platform.

zabel.elements.clients

The zabel.elements.clients module provides a wrapper class per tool.

It relies on the zabel-commons library, using its zabel.commons.exceptions module for the ApiError exception class, its zabel.commons.sessions module for HTTPS session handling, and its zabel.commons.utils module that contains useful functions.

Conventions for Clients

If an existing library already provides all the needed functionality, there is no need to add it to this library.

If an existing library already provides some of the needed functionality, a wrapper class can be written that will use this existing library as a client. Do not inherit from it.

Wrapper classes have two parts: a base part that implements single API calls (and possibly pagination), and a regular part that inherits from the base part and possibly extends it.

The base part may not exist if an already existing library provides wrappers for the needed low-level calls. In such a case, the regular class may simply use the existing library as a client and inherit from object.

Similarly, the regular part may be empty, in that it may simply inherit from the base class and contain no additional code.

At import time, wrapper classes should not import libraries not part of the Python standard library or requests or modules part of the zabel-commons library. That way, projects not needing some tool do not have to install their required dependencies. Wrapper classes may import libraries in their __init__() methods, though.

If an API call is successful, it will return a value (possibly None). If not, it will raise an ApiError exception.

If a wrapper class method is called with an obviously invalid parameter (wrong type, not a permitted value, ...), a ValueError exception will be raised.

Note

Base classes do not try to provide features not offered by the tool API.

Their methods closely match the underlying API.

They offer a uniform (or, at least, harmonized) naming convention, and may simplify technical details (pagination is automatically performed if needed).

zabel.elements.images

The zabel.elements.images module provides image wrappers for the built-in clients' classes (those defined in the zabel.elements.clients module).

Those abstract image wrappers implement an __init__() constructor with no parameter and a default run() method that can be overridden.

Managed services also implement at least the list_members() method of the ManagedServiceApp interface. They may provide get_member() if a fast implementation is available.

Concrete classes deriving those abstract managed services wrappers should provide a get_canonical_member_id() method that takes a parameter, a user from the wrapped API point of view, and returns the canonical user ID, as well as a get_internal_member_id() method that takes a canonical user ID and returns the internal key for that user.

They should also provide concrete implementations for the remaining methods provided by the ManagedServiceApp interface.

Conventions for Images

Utilities images must implement the UtilityApp interface and managed services images must implement the ManagedServiceApp interface.

License

Copyright (c) 2019 Martin Lafaix (martin.lafaix@external.engie.com) and others

This program and the accompanying materials are made
available under the terms of the Eclipse Public License 2.0
which is available at https://www.eclipse.org/legal/epl-2.0/

SPDX-License-Identifier: EPL-2.0

Metadata

Release files for zabel-elements 1.51.2

For a detailed explanation of source distributions (sdists) and built distributions (wheels), please see the package formats documentation.

Built distribution (wheel)

Table of built distributions (wheels) for zabel-elements 1.51.2
File Interpreter ABI Platform Actions
zabel_elements-1.51.2-py3-none-any.whl Python 3 none any Details for zabel_elements-1.51.2-py3-none-any.whl

Release files / zabel_elements-1.51.2-py3-none-any.whl

Download URL zabel_elements-1.51.2-py3-none-any.whl
Size 210.7 kB
Tags Python 3
SHA-256 checksum
How to use checksums
7899cea26cfb02c10b0579a8d8b46c7f6999939d520a2e66235fdc49528f1b78
BLAKE2b-256 checksum
How to use checksums
cec1eb194ab6e965949105efb90c5bc3b7f01fbfa3d86b151092505cf1e6f88e
Upload date
Uploaded using Trusted Publishing?
What is trusted publishing?
No
Uploaded via twine/7.0.0 CPython/3.12.3

Security for zabel-elements 1.51.2

Provenance

Provenance describes where a file came from. On PyPI, provenance is shared via attestations, which provide a verifiable record of the build or publishing details. View details, limitations and caveats.

No provenance found

None of the files in this release were uploaded with provenance metadata.

A note on package security

PyPI is a repository for distributing packages, not a service for auditing them. While third-party security researchers and our staff do their best to detect and remove malicious packages, PyPI cannot guarantee the quality, security or suitability of any given package.

To learn more about protecting yourself from malicious actors, visit our package security documentation.

Release history Release notifications | RSS feed

This release

1.51.2 This release

1 release file No provenance

Anthropic, PBC Visionary sponsor Bloomberg Visionary sponsor Hudson River Trading Visionary sponsor Meta Visionary sponsor NVIDIA Visionary sponsor Microsoft Sustainability sponsor Depot Continuous Integration AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Sentry Error logging StatusPage Status page