Skip to content
This repository was archived by the owner on Dec 2, 2018. It is now read-only.
This repository was archived by the owner on Dec 2, 2018. It is now read-only.

Code Improvements #2

@snowch

Description

@snowch
  • Rename IAE -> IAE_Service_Instance_Operations(cf)

  • Create:

    • IAE_Spark_Livy_Operations(vcap)
    • IAE_Spark_Ssh_Operations(vcap)
  • CF API calls, don't store whole json, store only required items:

    self.info = self._get_info()
    ...
    def _get_info(self):
        url = '{}/v2/info'.format(self.api_endpoint)
        response = self._request(url=url, http_method='get', description='_get_info', create_auth_headers=False)
        return response.json()

to

    def _get_info(self):
        url = '{}/v2/info'.format(self.api_endpoint)
        response = self._request(url=url, http_method='get', description='_get_info', create_auth_headers=False)
        return response.json()['authorization_endpoint'] + '/oauth/token'
  • simplify IAE responses, users should not have to see cloud foundry details by default
if status == 'succeeded':
   credentials_json = iae.create_credentials(cluster_instance_id)
   vcap_json = credentials_json['entity']['credentials']
   print('>> VCAP:\n' + json.dumps(vcap_json, indent=4, separators=(',', ': ')))

Should be:

if status == 'succeeded':
   vcap_json = iae.create_credentials(cluster_instance_id)
   print('>> VCAP:\n' + json.dumps(vcap_json, indent=4, separators=(',', ': ')))

Metadata

Metadata

Assignees

No one assigned

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions