Permalink
Commits on Apr 19, 2017
  1. [java] Updated with v16 java source

    mthakkar committed Apr 17, 2017
Commits on Apr 3, 2017
  1. [api][services] OPSAPS-39906 Add a sample script for

    S3Guard Prune to the API examples
    
    I have added a simple utility script to the Python examples
    for,
    1. Listing the supported account types for a category.
    2. Listing the credential names for an account type.
    3. Executing S3Guard prune command for the given credential
    name.
    4. Listing the supported categories.
    
    Also, I allowed CM options to be configurable via arguments
    instead of hard-coding them in the script.
    
    This would be also added to our docs.
    
    Testing done:
    -Tested a real cluster than the script works.
    -Tested various input cases for the script.
    
    (cherry picked from commit 8414ee9d77ef825bb303e43d4f43ec78cc2314b3)
    (cherry picked from commit 5383a62333e1fdc5bda374953fc274a15a3f7c57)
    Aravind Selvan committed Feb 23, 2017
Commits on Feb 27, 2017
Commits on Feb 23, 2017
  1. [api][s3g] OPSAPS-39155 Python client changes for

    Prune command
    
    This change adds a new 'command by name' endpoint
    to external accounts that would be used to invoke
    S3PruneCommand
    
    Testing done:
    -make clean; python setup.py install; make test; make dist;
    -Using a Python script, tested that S3GuardPrune works
    on a cdep cluster.
    Aravind Selvan committed Feb 23, 2017
Commits on Feb 17, 2017
  1. [api] OPSAPS-39252 API endpoint for External Account Configs

    Vivek Chaudhary committed Feb 17, 2017
Commits on Feb 2, 2017
  1. [api] Bump version to v16 for 5.11

    This change is not intended for master.
    
    No-Crossport: master
    
    Testing:
    * make test (from python dir)
    * mvn install (from java dir)
    Darren Lo committed Jan 25, 2017
Commits on Jan 27, 2017
  1. [api] OPSAPS-31699 Add SSL context argument to ApiResource

    Starting in Python 2.7, SSL certificate validation is turned on by
    default (yay!), but means that if CM is using an SSL certificate not
    signed by a public CA, Python API calls will fail. To allow specifying
    a local CA certificate, we need to allow API users to pass in a custom
    SSL context. This change adds the SSL context argument to ApiResource.
    Because HTTPSHandler only supports the context argument in Python 2.7.9
    and above, this feature is only available in those versions.
    
    Testing:
    - Added an example script which connects to CM using a custom CA cert
    - Tested against my cluster which has HTTPS turned on
    jtran-cloudera committed Jan 27, 2017
Commits on Dec 9, 2016
  1. [recommission] OPSAPS-36382 Python API changes to support recommssion…

    … with start
    
    Added to api endpoints hosts_recommission_with_start() and recommission_with_start()
    for api_version >= 15.
    These endpoints will start decommissioned roles before doing the recommission.
    Francis Pang committed Dec 7, 2016
Commits on Nov 30, 2016
  1. [scm] OPSAPS-37770 Add cluster UUID

    The readonly attribute will only be present when using API>=15.
    hermancc committed Nov 30, 2016
Commits on Nov 29, 2016
Commits on Nov 17, 2016
  1. [API] OPSAPS-37912 part 3 Change the CM API to v15 for CM5.10

    CM Python API side changes. This change is only for cm5-5.x branch.
    
    Testing:
    make test (from python dir)
    mvn install (from java dir)
    Shailesh Shiwalkar committed Nov 17, 2016
Commits on Aug 29, 2016
  1. [cm-api] OPSAPS-36009 Comment for command retry in the cm_api Python

    github needs to be updated.
    
    - Removed the note in the comment/doc "Note: The retry will only work
    for ClusterUpgrade command for now". This is not valid anymore and more
    commands could become retriable soon. Maintaining a while list here is
    not reasonable. A command that cannot be retried its canRetry attribute
    will be false. That should be good enough.
    Vivek Chaudhary committed Aug 29, 2016
Commits on Aug 27, 2016
  1. [DR] OPSAPS-35892 cm_api changes for HDFS Cloud replication schedule …

    …args
    
    o Cloud HDFS Replication now has two for cloud accounts.
    o user is expected to use one of them for given schedule.
    o Unit test case changes.
    Nachiket Vaidya committed with jenkins Jul 26, 2016
Commits on Aug 22, 2016
Commits on Aug 17, 2016
  1. [scm] OPSAPS-35700 Add external accounts to python API.

        Identical modeling to the final API model in OPSAPS-34817.
    
        Testing:
         - test scripts to test each of the APIs separately against a recent server
         - new unit tests
    
        Sample python script:
        ----
        from cm_api.api_client import ApiResource, ApiException, API_CURRENT_VERSION
        api = ApiResource(server_host="test-1.cloudera.com", username="admin", password="admin", version=14)
        cats = api.get_supported_external_account_categories()
        print "cat: %s" %(cats)
        for cat in cats:
          types = api.get_supported_external_account_types(cat.name)
          for type_ in types:
            print "type: %s, allowed: %s" %(type_.name, type_.allowedAccountConfigs)
    
        name = "test7"
        acct = api.create_external_account(name=name, display_name=name,
          type_name="AWS_ACCESS_KEY_AUTH")
        print "Created: %s" % acct
    
        acct.accountConfigs['aws_access_key'] = "test1"
        acct.accountConfigs['aws_secret_key'] = "test2"
    
        acct_updated = api.update_external_account(acct)
        print "Updated: %s with configs: %s" % (acct_updated, acct_updated.accountConfigs)
    
        acct_deleted = api.delete_external_account(acct.name)
        print "Deleted: %s" % acct_deleted
        ---
    Jayesh Seshadri committed Aug 17, 2016
Commits on Aug 15, 2016
  1. [scm] OPSAPS-35724 Add "sensitive" to ApiConfig

    Trivial change, matching OPSAPS-35589.
    
    Testing: Verified failure with "full" views goes away with update, and "sensitive" is parsed correctly.
    Jayesh Seshadri committed Aug 15, 2016
Commits on Aug 10, 2016
  1. [API] OPSAPS-35644 | Add update_user() method to python API client.

    Bug: OPSAPS-35644
    
    Issue:
    Need update_user() method in python API client.
    
    Implementation:
    - Add update_user() python API client.
    - Update mock unit test.
    
    Reviewer: alexm, jayesh
    
    Tests:
    - Ran updated unit test.
    
    - Wrote a python client program to test update
    operation on user.
    
    from cm_api.api_client import ApiResource
    from cm_api.endpoints.users import ApiUser
    
    CM_HOST = "bankim-agent-1.vpc.cloudera.com"
    CM_PORT = 7180
    CM_USERNAME = "admin"
    CM_PASSWD = "admin"
    
    api = ApiResource(CM_HOST, CM_PORT, CM_USERNAME, CM_PASSWD, version=7)
    for u in api.get_all_users():
      print u.name
      print ','.join(u.roles)
      if u.name == "guest":
        n = ApiUser(api, u.name, roles=[ 'ROLE_LIMITED' ])
        api.update_user(n)
    
    for u in api.get_all_users():
      print u.name
      print ','.join(u.roles)
    
    bankim@osboxes:~/scripts$ python user.py
    admin
    ROLE_ADMIN
    guest
    ROLE_USER
    admin
    ROLE_ADMIN
    guest
    ROLE_LIMITED
    Bankim Bhavsar committed Aug 10, 2016
Commits on Jul 18, 2016
  1. [bdr] OPSAPS-35146 Include hive UDF properties into ApiHiveReplicatio…

    …nResult
    
    Missed this in my original changes for OPSAPS-21647.
    
    Testing:
    -Ran API unit tests (with new test params)
    -Ran python v13 client and python v14 client against a CM with hive UDF results; verified output matches schema, and there were no parse errors.
    Jayesh Seshadri committed Jul 18, 2016
Commits on Jul 14, 2016
  1. [Cloudera Manager] OPSAPS-34769 Update CM python API Client

    for new add/list/delete watched dirs
    
    Description:
    Add 'add/list/remove watcheddir' methods in 'services.py' as the client functions;
    Add 'ApiWatchedDirList' and 'ApiWatchedDir' classes in 'types.py' as new
    data types; Create 'test_watcheddir.py' and add four test cases capturing
    'add/list/remove watched directories' behaviors.
    
    Test done:
    End-to-end test, running the added methods (in 'services.py') on CM server and
    verify results;
    python setup.py install;
    make clean test.
    Quan Yang committed Jul 13, 2016
Commits on Jun 30, 2016
  1. [API][SupportIntegration] OPSAPS-32230 Set API version to 2 for coll…

    …ect_diagnostic_data()
    
     collect_diagnostic_data() was deprecated, in place of collect_diagnostic_data_45(), in CM API
     version 3 which was introduced as a part of CM 4.5.
    
     Testing done:
     -make test
    Aravind Selvan committed Jun 30, 2016
Commits on Jun 27, 2016
  1. OPSAPS-32613 [DR] (PART VI) Add python APIs for hdfs s3 replication

    1. added class ApiHdfsCloudReplicationArguments;
    2. changed class ApiReplicationSchedule by adding field 'hdfsCloudArguments';
    3. changed to allow cloud schedule creation;
    4. added unit tests.
    Lei Shi committed with lei shi May 6, 2016
Commits on Jun 25, 2016
  1. Make setup.py more tolerant of invocation mode.

    Without this change, setup.py may be sensitive to whether or not
    it is referred to with a directory or not:
    
    python ./setup.py ....
    
    vs
    
    python setup.py ....
    Michal Ostrowski committed Jun 24, 2016
  2. Add top-level setup.py

    This file is basically a symlink to "python/setup.py" expressed in
    python code.  If python executes "setup.py", it will be effectively
    executing "python/setup.py".
    This is required to allow PIP installation from a git repo, which assumes
    that "setup.py" is at the root.
    
    e.g.:
    
    pip install 'git+http://github.mtv.cloudera.com/Starship/cm_api#egg=cm_api-13.0.0'
    Michal Ostrowski committed Apr 28, 2016
  3. Use os.path.normpath for source paths.

    setuptools is sensitive to "src" vs "./src" and prefers the former.
    This doesn't matter much, but without using the former generated packages
    cannot be correctly specified as dependencies of othe packages via a git
    transport.
    
    Make python package zip-safe (i.e. allow execute from zipfile).
    Michal Ostrowski committed Apr 27, 2016
Commits on Jun 20, 2016
  1. [api] OPSAPS-34577 Bump CM API to v14 (CM Python API side changes)

    Bump up the CM python API version to 14.
    
    Testing:
    make test
    Aravind Selvan committed Jun 20, 2016
Commits on May 16, 2016
Commits on May 12, 2016
Commits on Apr 21, 2016
  1. Fix selection of source directories to allow for use of absolute_import.

    The inclusion of "cm_api", "cm_shell" as part of the location rather than
    the package name prevents python programs using
    "from __future__ import absolute_import".
    Michal Ostrowski committed Apr 4, 2016
Commits on Apr 19, 2016
  1. [api] OPSAPS-33039 CM API support for collecting global diag bundle f…

    …or a certain time range
    
    Adding start_time parameter to collect diagnostics data. Valid since v13.
    
    Testing done:
    make test
    make dist
    Aravind Selvan committed Apr 16, 2016
Commits on Apr 15, 2016
  1. [api] OPSAPS-32887 CM API version needs to be incremented to 13

    Bump API version to 13 for CM 5.8 on the CM Python API
    
    Testing:
    make test
    Aravind Selvan committed Mar 30, 2016
Commits on Mar 22, 2016
  1. [diag bundles/charts] OPSAPS-32866 Use the optional metrics collectio…

    …n argument in the collect_diag_data API call only for versions >= 13
    gkamat committed Mar 22, 2016
Commits on Mar 18, 2016
  1. [diag bundles/charts] OPSAPS-29951 CM API change for packaging servic…

    …e and host monitor metrics data into diagnostic bundles
    gkamat committed Mar 18, 2016
Commits on Mar 10, 2016
  1. [api] OPSAPS-32658. Support pools refresh starting v6

    Since it's actually been around for a while.
    hermancc committed Mar 10, 2016
  2. [api] OPSAPS-32658. Add pools refresh endpoint

    Nothing special. It's been MIA for a while.
    
    >>> from cm_api.api_client import ApiResource
    >>> api=ApiResource("nightly-1.gce.cloudera.com", username="admin", password="admin")
    >>> cluster=api.get_cluster("Cluster 1")
    >>> cmd = cluster.pools_refresh()
    hermancc committed Mar 10, 2016