diff options
Diffstat (limited to 'src/orchestration/vmb_messages.py')
| -rw-r--r-- | src/orchestration/vmb_messages.py | 174 |
1 files changed, 174 insertions, 0 deletions
diff --git a/src/orchestration/vmb_messages.py b/src/orchestration/vmb_messages.py new file mode 100644 index 0000000..515dc03 --- /dev/null +++ b/src/orchestration/vmb_messages.py @@ -0,0 +1,174 @@ +# -*- coding: UTF-8 -*- +from pulsar.schema import * + +''' +Topic - VCP Far Edge Namespace Provisioning +Payload +Format: JSON +Example Content: +{ + "reportName": “vcp_fe_namespace”, + "reportDescription": null, + "reportGeneratedOn": "2020-04-28T09:06:32.1962088-04:00", + "rowCount": 1, + "reportDataRows": [{ + "cluster”: "wsbomagj-d654321-001", + “namespace”: “WSBOMAGJ-441352VZWcVDU-Y-SM-x-001” + “location”: 654321 + “created_at”: 2020-01-07 04:16:15.743617 + }] +} +''' +class RemoteRegion(Record): + cluster = String() + namespace = String() + location = String() + created_at = String() + +class NameSpaceMessage(Record): + reportName = String() + reportDescription = String() + reportGeneratedOn = String() + rowCount = Integer() + reportDataRows = Array(RemoteRegion()) + +''' +Topic - VCP Far Edge Cluster Status +Payload +Format: JSON +Example Content: +{ + "reportName": “vcp_fe_cluster_status”, + "reportDescription": null, + "reportGeneratedOn": "2020-04-28T09:06:32.1962088-04:00", + "rowCount": 1, + "reportDataRows": [{ + “name”: "wsbomagj-d654321-001", + “description”: NE CONCORD 8_NH + “location”: 654321 + “software version”: 19.12 + “availability”: online + “deploy_status”: complete + “created_at”: 2020-01-07 04:16:15.743617 + “updated_at”: 2020-01-07 06:03:10.854598 + }] +} +''' +class ClusterStatus(Record): + name = String() + description = String() + software_version = String() + location = String() + availability = String() + deploy_status = String() + created_at = String() + updated_at = String() + +class ClusterStatusMessage(Record): + reportName = String() + reportDescription = String() + reportGeneratedOn = String() + rowCount = Integer() + reportDataRows = Array(ClusterStatus()) + +''' +Topic - VCP Far Edge Kubeconfig Token +Payload +Format: JSON +Example Content: +{ + "reportName": “vcp_fe_kubeconfig”, + "reportDescription": null, + "reportGeneratedOn": "2020-04-28T09:06:32.1962088-04:00", + "rowCount": 1, + "reportDataRows": [{ + “cluster”: "wsbomagj-d654321-001", + “namespace”: “WSBOMAGJ-441352VZWcVDU-Y-SM-x-001” + “location”: 654321 + “kubeconfig”: <Example kubeconfig> + “created_at”: 2020-01-07 04:16:15.743617 + }] +} +--- +Example kubeconfig: + +apiVersion: v1 +kind: Config +users: +- name: ldap-user + user: + token: eyJhbGciOiJSUzI1NiIsImtpZCI6IiJ9.eyJpc3MiOiJrdWJlcm5ldGVzL3NlcnZpY2VhY2NvdW50Iiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9uYW1lc3BhY2UiOiJub2tpYSIsImt1YmVybmV0ZXMuaW8vc2VydmljZWFjY291bnQvc2VjcmV0Lm5hbWUiOiJzYTEtdG9rZW4tbW5mMmoiLCJrdWJlcm5ldGVzLmlvL3NlcnZpY2VhY2NvdW50L3NlcnZpY2UtYWNjb3VudC5uYW1lIjoic2ExIiwia3ViZXJuZXRlcy5pby9zZXJ2aWNlYWNjb3VudC9zZXJ2aWNlLWFjY291bnQudWlkIjoiZTA5YTkwMDItMTg0Zi0xMWVhLWE5NzYtMDgwMDI3YTFjODc3Iiwic3ViIjoic3lzdGVtOnNlcnZpY2VhY2NvdW50Om5va2lhOnNhMSJ9.e9uD5kMmAT0HRboSTAbH5xlkETkltLclVQ2GedvoeUmH76WB6G5kGWQrhJjkjpMtPDKxWp6wTzZdEXXwGYGdB6aXbaxcAmau1qid5NGz725BtaoRbSVS2Uk6XrOSNfycFzqc8Z7GTX81VtKKSPYnjeMo47W6FqHw6qk0NEpLLxbpGfJHz8w2KZQiuvI-JRQXtA3PHW3tEaWq3ME3XnYgHNSRJmoiKA99bWjN-HKoOsBDMjhX7kw_VtycRYJ1gbqXmVsSl7BuAQjoplnLN_stRt7ZgpsV4aqmZueqJqHaglB91XOeqe_JcD5unLMb3B5VXpEXPp3V6tjLIyVD8F8XbA +clusters: +- cluster: + server: https://<IPv6>:8443 + name: wsbomagj-d654321-001 +contexts: +- context: + cluster: wsbomagj-d654321-001 + user: ldap-user + namespace: WSBOMAGJ-441352VZWcVDU-Y-SM-x-001 + name: ldap-user +current-context: ldab-user +''' +class Kubeconfig(Record): + transactionId = String() + cluster = String() + namespace = String() + location = String() + kubeconfig = String() + created_at = String() + updated_at = String() + +class KubeconfigMessage(Record): + reportName = String() + reportDescription = String() + reportGeneratedOn = String() + rowCount = Integer() + reportDataRows = Array(Kubeconfig()) + +''' +Topic - VCP Far Edge Image Status +Payload +Format: JSON +Example Content: + +Image Upload Example +{ + "reportName": “vcp_fe_imagestatus”, + "reportDescription": null, + "reportGeneratedOn": "2020-04-28T09:06:32.1962088-04:00", + "rowCount": 2, + "reportDataRows": [{ + “cluster”: "wsbomagj-d654321-001", + “image”: “i1” + “action”: “UPLOAD” + “status”: “SUCCESS” + “message”:”Image Successfully Deleted” + “created_at”: 2020-01-07 04:16:15.743617 + } + { + “cluster”: "wsbomagj-d654321-001", + “image”: “i2” + “action”: “UPLOAD” + “status”: “FAILED” + “message”:”Image Not Present in Artifactory” + “created_at”: 2020-01-07 04:16:15.743617 + }] +} +''' +class ImageStatus(Record): + cluster = String() + image = String() + action = String() + status = String() + message = String() + created_at = String() + +class ImagesStatusMessage(Record): + reportName = String() + transactionId = String() + reportDescription = String() + reportGeneratedOn = String() + rowCount = Integer() + reportDataRows = Array(ImageStatus()) + |
