ambari-dev mailing list archives

Site index · List index
Message view « Date » · « Thread »
Top « Date » · « Thread »
From "Yurii Shylov (JIRA)" <j...@apache.org>
Subject [jira] [Created] (AMBARI-8510) Repository Version Management > Refactor API
Date Tue, 02 Dec 2014 16:03:12 GMT
Yurii Shylov created AMBARI-8510:
------------------------------------

             Summary: Repository Version Management > Refactor API
                 Key: AMBARI-8510
                 URL: https://issues.apache.org/jira/browse/AMBARI-8510
             Project: Ambari
          Issue Type: Technical task
          Components: ambari-server
    Affects Versions: 2.0.0
            Reporter: Yurii Shylov
            Assignee: Yurii Shylov
             Fix For: 2.0.0


Update the APIs for repository_version and stack_version resources to be consistent with the
/stacks API.

For repository_version change existing API to:
Add it to stacks:
{code}
GET /api/v1/stacks/HDP/versions/2.2/
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2",
  "Versions" : {
    "active" : true,
    "min_upgrade_version" : null,
    "parent_stack_version" : "2.1",
    "stack_name" : "HDP",
    "stack_version" : "2.2",
    "config_types" : {
      "cluster-env" : {
        "supports" : { }
      }
    }
  },
  "configurations" : [ ... ],
  "services" : [ ... ],
  "operating_systems" : [ ... ],
  "upgrade_packs" : ["upgrade-2.2"],
  "repository_versions" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1",
      "RepositoryVersions" : {
        "id" : 1,
        "stack_name" : "HDP",
        "stack_version" : "2.2"
      }
    }
  ]
}
{code}

Create:
{code}
POST /api/v1/stacks/HDP/versions/2.2/repository_versions/
{
  "RepositoryVersions": {
    "repository_version": "2.2.0.1-885",
    "display_name" : "HDP-2.2.0",
    "operating_systems" : [
      {
        "OperatingSystems" : {
          "os_type" : "redhat5"
        },
        "repositories" : [
          {
            "Repositories" : {
              "repo_id" : "HDP-2.2",
              "repo_name": "HDP",
              "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0"
            }
          },
          {
            "Repositories" : {
              "repo_id" : "HDP-UTILS-1.1.0.20",
              "repo_name": "HDP-UTILS",
              "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0"
            }
          }
        ]
      }
    ]
  }
}
{code}

Get single:
{code}
GET /api/v1/stacks/HDP/versions/2.2/repository_versions/1
{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1",
  "RepositoryVersions" : {
    "display_name" : "HDP 2.2.0",
    "id" : 1,
    "repository_version" : "2.2.0.1-885",
    "stack_name" : "HDP",
    "stack_version" : "2.2",
    "upgrade_pack" : "upgrade-2.2"
  },
  "operating_systems" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1/operating_systems/redhat5",
      "OperatingSystems" : {
        "os_type" : "redhat5",
        "repository_version_id" : 1,
        "stack_name" : "HDP",
        "stack_version" : "2.2"
      }
    }
  ]
}
{code}

Get all info:
{code}
GET /api/v1/stacks/HDP/versions/2.2/repository_versions/1?fields=operatingSystems/repositories/*

{
  "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1?fields=operating_systems/repositories/*",
  "RepositoryVersions" : {
    "id" : 1,
    "stack_name" : "HDP",
    "stack_version" : "2.2"
  },
  "operating_systems" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1/operating_systems/redhat5",
      "OperatingSystems" : {
        "os_type" : "redhat5",
        "repository_version_id" : 1,
        "stack_name" : "HDP",
        "stack_version" : "2.2"
      },
      "repositories" : [
        {
          "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1/operating_systems/redhat5/repositories/HDP-2.2",
          "Repositories" : {
            "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
            "default_base_url" : "",
            "latest_base_url" : "",
            "mirrors_list" : "",
            "os_type" : "redhat5",
            "repo_id" : "HDP-2.2",
            "repo_name" : "HDP",
            "repository_version_id" : 1,
            "stack_name" : "HDP",
            "stack_version" : "2.2"
          }
        },
        {
          "href" : "http://c6401.ambari.apache.org:8080/api/v1/stacks/HDP/versions/2.2/repository_versions/1/operating_systems/redhat5/repositories/HDP-UTILS-1.1.0.20",
          "Repositories" : {
            "base_url" : "http://s3.amazonaws.com/dev.hortonworks.com/HDP/centos5/2.x/updates/2.2.0.0",
            "default_base_url" : "",
            "latest_base_url" : "",
            "mirrors_list" : "",
            "os_type" : "redhat5",
            "repo_id" : "HDP-UTILS-1.1.0.20",
            "repo_name" : "HDP-UTILS",
            "repository_version_id" : 1,
            "stack_name" : "HDP",
            "stack_version" : "2.2"
          }
        }
      ]
    }
  ]
}
{code}

Delete
{code}
DELETE /api/v1/stacks/HDP/versions/2.2/repository_versions/1
{code}

Update
{code}
PUT /api/v1/stacks/HDP/versions/2.2/repository_versions/1
{code}

Cluster stack vesrions:
{code}
GET /api/v1/clusters/c1/stack_versions/1
{
  "ClusterStackVersions": {
    "id": 1,
    "cluster_name": "c1",
    "stack": "HDP",
    "version": "2.2",
    "state": "INSTALLING",
    "host_states": {
      INIT: [],
      INSTALLING: [],
      DISTRIBUTED: [],
      INSTALLED: ["host2"],
      UPGRADING: [],
      UPGRADED: [],
      UPGRADE_FAILED: [],
      CURRENT: ["host1"]
    },
    "repository_versions" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/1/stack_versions/1/repository_versions/2",
      "RepositoryVersions" : {
        "id" : 2,
        "stack_name" : "HDP",
        "stack_version" : "2.1"
      }
    }
  ]
}
{code}

Host stack versions:
{code}
GET /api/v1/hosts/host1/stack_versions/1
{
  "HostStackVersions": {
    "id": 1,
    "host_name": "host1",
    "stack": "HDP",
    "version": "2.2",
    "state": "INSTALLING",
    "repository_versions" : [
    {
      "href" : "http://c6401.ambari.apache.org:8080/api/v1/clusters/1/stack_versions/1/repository_versions/2",
      "RepositoryVersions" : {
        "id" : 2,
        "stack_name" : "HDP",
        "stack_version" : "2.2"
      }
    }
  }
}
{code}




--
This message was sent by Atlassian JIRA
(v6.3.4#6332)

Mime
View raw message