Skip to content
This repository has been archived by the owner on Feb 16, 2022. It is now read-only.

Create MLOPS SCC entry with ansible #21

Open
snowch opened this issue Feb 1, 2022 · 0 comments
Open

Create MLOPS SCC entry with ansible #21

snowch opened this issue Feb 1, 2022 · 0 comments
Assignees
Labels
enhancement New feature or request

Comments

@snowch
Copy link
Member

snowch commented Feb 1, 2022

To update the MLOPS SCC configuration:

POST /api/v2/k8scluster/ {cluster_id} /kubectl

With payload data:

data = {
    "op": {kubectl_op}, // "create", "apply", "delete"
    "data": { 
      "apiVersion": "", 
      "kind": "", 
      "metadata": { 
        "namespace": "", 
        "name": "", 
        "labels":{ 
           "kubedirector.hpe.com/cmType": "source-control", 
           "createdByUser": "", 
           "createdByRole": "", 
           "parentConfiguration": "" 
         }
       }, 
      "data":{
         "sourceControlName": "",
         "type": "github | bitbucket", 
         "repoURL": "", 
         "authType": "token | password", 
         "branch": "", 
         "workingDirectory": "", 
         "proxyProtocol": "", 
         "proxyHostname": "", 
         "proxyPort": "", 
         "username": "", 
         "email": "", 
         "token": "", 
         "description": "" 
      }
   }
}

more information to follow on:

data.apiVersion
data.kind
data.metadata.labels.parentConfiguration (how do we retrieve this)?

E.g. Parent

{
  "method": "post",
  "apiurl": "https://127.0.0.1:8080",
  "timeout": 239,
  "data": {
    "kubectl_op": "create",
    "cluster_href": "/api/v2/k8scluster/1",
    "payload": {
      "apiVersion": "v1",
      "kind": "ConfigMap",
      "metadata": {
        "namespace": "k8s-tenant-1",
        "name": "abc",
        "labels": {
          "kubedirector.hpe.com/cmType": "source-control",
          "createdByUser": "6",
          "createdByRole": "Admin"
        }
      },
      "data": {
        "type": "github",
        "repoURL": "[email protected]:hpe-container-platform-community/example_active_directory_server.git",
        "authType": "token",
        "branch": "main",
        "workingDirectory": "",
        "proxyProtocol": "",
        "proxyHostname": "",
        "proxyPort": "",
        "description": ""
      }
    }
  },
  "op": "source_control_action"
}

Example child

{
  "method": "post",
  "apiurl": "https://127.0.0.1:8080",
  "timeout": 239,
  "data": {
    "kubectl_op": "create",
    "cluster_href": "/api/v2/k8scluster/1",
    "payload": {
      "apiVersion": "v1",
      "kind": "ConfigMap",
      "metadata": {
        "namespace": "k8s-tenant-1",
        "name": "mysccchild",
        "labels": {
          "kubedirector.hpe.com/cmType": "source-control",
          "createdByUser": "22",
          "createdByRole": "Member",
          "parentConfiguration": "myscc"
        }
      },
      "data": {
        "type": "github",
        "repoURL": "[email protected]:hpe-container-platform-community/example_active_directory_server.git",
        "authType": "token",
        "branch": "main",
        "workingDirectory": "",
        "proxyProtocol": "",
        "proxyHostname": "",
        "proxyPort": "",
        "username": "mygitusername",
        "email": "[email protected]",
        "token": "mygittoken",
        "description": ""
      }
    }
  },
  "op": "source_control_action"
}
@snowch snowch changed the title Create MLOPS SCC entry Create MLOPS SCC entry with ansible Feb 1, 2022
@snowch snowch self-assigned this Feb 1, 2022
@snowch snowch added the enhancement New feature or request label Feb 1, 2022
Sign up for free to subscribe to this conversation on GitHub. Already have an account? Sign in.
Labels
enhancement New feature or request
Projects
None yet
Development

No branches or pull requests

1 participant