Skip to content

GitLab Next

  • Projects
  • Groups
  • Snippets
  • Help
    • Loading...
  • Help
    • Help
    • Support
    • Community forum
    • Submit feedback
    • Contribute to GitLab
  • Sign in / Register
GitLab GitLab
  • Project overview
    • Project overview
    • Details
    • Activity
    • Releases
  • Repository
    • Repository
    • Files
    • Commits
    • Branches
    • Tags
    • Contributors
    • Graph
    • Compare
    • Locked Files
  • Issues 38,038
    • Issues 38,038
    • List
    • Boards
    • Labels
    • Service Desk
    • Milestones
    • Iterations
  • Merge requests 1,346
    • Merge requests 1,346
  • Requirements
    • Requirements
    • List
  • CI/CD
    • CI/CD
    • Pipelines
    • Jobs
    • Schedules
    • Test Cases
  • Operations
    • Operations
    • Metrics
    • Incidents
    • Environments
  • Packages & Registries
    • Packages & Registries
    • Container Registry
  • Analytics
    • Analytics
    • CI/CD
    • Code Review
    • Insights
    • Issue
    • Repository
    • Value Stream
  • Snippets
    • Snippets
  • Members
    • Members
  • Activity
  • Graph
  • Create a new issue
  • Jobs
  • Commits
  • Issue Boards
Collapse sidebar
  • GitLab.org
  • GitLabGitLab
  • Merge requests
  • !36001

Merged
Created Jul 04, 2020 by Serena Fang@serenafang🍥Developer8 of 13 tasks completed8/13 tasks

Add API support for instance clusters

  • Overview 53
  • Commits 1
  • Pipelines 29
  • Changes 6

What does this MR do?

Create:

curl --header "Private-Token: $LOCAL_TOKEN" "http://10.0.4.70:3000/api/v4/admin/clusters/add" \
-H "Accept: application/json" \
-H "Content-Type:application/json" \
-X POST --data '{"name":"new-cluster", "platform_kubernetes_attributes":{"api_url":"https://example.com","token":"12345"}}'

Read:

  • Get all clusters: curl -H “PRIVATE-TOKEN: $LOCAL_TOKEN” “http://172.16.123.1:3000/api/v4/admin/clusters”
  • Get a specific cluster: curl -H “PRIVATE-TOKEN: $LOCAL_TOKEN” “http://172.16.123.1:3000/api/v4/admin/clusters/3”

Update:

curl --header "Private-Token: $LOCAL_TOKEN" "http://10.0.4.70:3000/api/v4/admin/clusters/3" \
-H "Content-Type:application/json" \
-X PUT --data '{"name":"new-cluster-name", "platform_kubernetes_attributes":{"api_url":"https://new-example.com","token":"new-token"}}'

Destroy: curl --request DELETE --header "Private-Token:$LOCAL_TOKEN" "http://10.0.4.70:3000/api/v4/admin/clusters/3"

Screenshots

Does this MR meet the acceptance criteria?

Conformity

  • Changelog entry
  • Documentation (if required)
  • Code review guidelines
  • Merge request performance guidelines
  • Style guides
  • Database guides
  • Separation of EE specific content

Availability and Testing

  • Review and add/update tests for this feature/bug. Consider all test levels. See the Test Planning Process.
  • Tested in all supported browsers
  • Informed Infrastructure department of a default or new setting change, if applicable per definition of done

Security

If this MR contains changes to processing or storing of credentials or tokens, authorization and authentication methods and other items described in the security review guidelines:

  • Label as security and @ mention @gitlab-com/gl-security/appsec
  • The MR includes necessary changes to maintain consistency between UI, API, email, or other methods
  • Security reports checked/validated by a reviewer from the AppSec team

Closes #31000 (closed)

Edited Jul 16, 2020 by Serena Fang
Assignee
Assign to
Reviewer
Request review from
13.2
Milestone
13.2 (Past due)
Assign milestone
Time tracking
Source branch: 31000-api-for-instance-level-kubernetes-clusters