Skip to main content

Python for Maximo Application Suite Dev/Ops

Project description

mas.devops

Code Style: Black Flake8: checked GitHub Actions Workflow Status PyPI - Version PyPI - Python Version PyPI - Downloads

Example

from kubernetes import dynamic
from kubernetes import config
from kubernetes.client import api_client

from mas.devops.ocp import createNamespace
from mas.devops.tekton import installOpenShiftPipelines, updateTektonDefinitions, launchUpgradePipeline

instanceId = "mymas"
pipelinesNamespace = f"mas-{instanceId}-pipelines"

# Create an OpenShift client
dynClient = dynamic.DynamicClient(
    api_client.ApiClient(configuration=config.load_kube_config())
)

# Install OpenShift Pipelines Operator
installOpenShiftPipelines(dynamicClient)

# Create the pipelines namespace and install the MAS tekton definitions
createNamespace(dynamicClient, pipelinesNamespace)
updateTektonDefinitions(dynamicClient, pipelinesNamespace, "/mascli/templates/ibm-mas-tekton.yaml")

# Launch the upgrade pipeline and print the URL to view the pipeline run
pipelineURL = launchUpgradePipeline(self.dynamicClient, instanceId)
print(pipelineURL)

mas-devops-create-initial-users

Add to /etc/hosts

127.0.0.1               tgk01-masdev.mas-tgk01-manage.svc.cluster.local
127.0.0.1               coreapi.mas-tgk01-core.svc.cluster.local
127.0.0.1               admin-dashboard.mas-tgk01-core.svc.cluster.local
SM_AWS_REGION=""
SM_AWS_ACCESS_KEY_ID=""
SM_AWS_SECRET_ACCESS_KEY=""

aws configure set default.region ${SM_AWS_REGION}
aws configure set aws_access_key_id ${SM_AWS_ACCESS_KEY_ID}
aws configure set aws_secret_access_key ${SM_AWS_SECRET_ACCESS_KEY}


oc login --token=sha256~xxx --server=https://xxx:6443

oc port-forward service/admin-dashboard 8445:443 -n mas-tgk01-core
oc port-forward service/coreapi 8444:443 -n mas-tgk01-core
oc port-forward service/tgk01-masdev 8443:443 -n mas-tgk01-manage

mas-devops-create-initial-users-for-saas \
    --mas-instance-id tgk01 \
    --mas-workspace-id masdev \
    --log-level INFO \
    --initial-users-secret-name "aws-dev/noble4/tgk01/initial_users" \
    --manage-api-port 8443 \
    --coreapi-port 8444 \
    --admin-dashboard-port 8445


mas-devops-create-initial-users-for-saas \
    --mas-instance-id tgk01 \
    --mas-workspace-id masdev \
    --log-level INFO \
    --initial-users-yaml-file /home/tom/workspaces/notes/mascore3423/example-users-single.yaml \
    --manage-api-port 8443 \
    --coreapi-port 8444 \
    --admin-dashboard-port 8445

Example of initial_users secret:

{"john.smith1@example.com":"primary,john1,smith1","john.smith2@example.com":"primary,john2,smith2","john.smith3@example.com":"secondary,john3,smith3"}

Project details


Release history Release notifications | RSS feed

Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

mas_devops-12.0.1.tar.gz (119.4 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

mas_devops-12.0.1-py3-none-any.whl (262.2 kB view details)

Uploaded Python 3

File details

Details for the file mas_devops-12.0.1.tar.gz.

File metadata

  • Download URL: mas_devops-12.0.1.tar.gz
  • Upload date:
  • Size: 119.4 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mas_devops-12.0.1.tar.gz
Algorithm Hash digest
SHA256 0c18d86aa5ae76c9f88ad45255ea49a19deb3972cdb3c97c819a573a745b8360
MD5 f63671c36589cf7f1bcf081ab9728680
BLAKE2b-256 c8b861acf4f887a7171b7d171e8f84d964c5828eaa2516b13d0090bd8397c743

See more details on using hashes here.

File details

Details for the file mas_devops-12.0.1-py3-none-any.whl.

File metadata

  • Download URL: mas_devops-12.0.1-py3-none-any.whl
  • Upload date:
  • Size: 262.2 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for mas_devops-12.0.1-py3-none-any.whl
Algorithm Hash digest
SHA256 af9bb5134445b75933c69f5375354741566ed0d2fd25cc728ad42d71f2b441c1
MD5 386f599b77d7c7eeb6c6989ad335c736
BLAKE2b-256 dbdd1fdf58cf3fb2e98ec9b0d1baeba06454049796c9be04672f352f17e90880

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page