cloudsmith adapter¶
Module to manage resources on cloudsmith.
Features¶
As of now, this module can only manage and discover entitlement tokens configured within a cloudsmith repository.
Api configuration¶
In order to use the cloudsmith api, the adapter will need an api token, it can be provided either directly in the model, or via an environment variable to the agent. The name of the environment variable should be picked by the user, and provided to the api entity.
Token in the model:
import cloudsmith
api = cloudsmith::Api(api_token="...")
Token in environment variable:
import cloudsmith
api = cloudsmith::Api(api_token_env_var="CLOUDSMITH_API_TOKEN")
Example¶
Here is a simple example that illustrates how to manage an entitlement token within a repo:
import cloudsmith
import cloudsmith::resources
api = cloudsmith::Api(api_token_env_var="CLOUDSMITH_API_TOKEN")
cloudsmith::resources::Entitlement(
name="test",
namespace="inmanta",
repo="test",
api=api,
token="super-secret-token-don't-reuse-it",
purged=false,
)