Git Product home page Git Product logo

rubrik-sdk-for-python's Introduction

Rubrik SDK for Python

master devel
Master Branch Status Devel Branch Status

This project provides a Python package that makes it easy to interact with the Rubrik CDM API.

The SDK has been tested against Python 2.7.6 and Python 3.6.4.

πŸ”¨ Installation

Install from pip:

pip install rubrik_cdm

Install from source:

$ git clone https://github.com/rubrikinc/rubrik-sdk-for-python
$ cd rubrik-sdk-for-python
$ python setup.py install

πŸ” Example

By default, the Rubrik SDK will attempt to read the the Rubrik Cluster credentials from the following environment variables:

  • rubrik_cdm_node_ip
  • rubrik_cdm_username
  • rubrik_cdm_password
  • rubrik_cdm_token
Note: The rubrik_cdm_username and rubrik_cdm_password must be supplied together and may not be provided if the rubrik_cdm_token variable is present
import rubrik_cdm
rubrik = rubrik_cdm.Connect()

cluster_version = rubrik.cluster_version()

print(cluster_version)

πŸ“˜ Documentation

Here are some resources to get you started! If you find any challenges from this project are not properly documented or are unclear, please raise an issue and let us know! This is a fun, safe environment - don't worry if you're a GitHub newbie! ❀️

πŸ’ͺ How You Can Help

We glady welcome contributions from the community. From updating the documentation to adding more functions for Python, all ideas are welcome. Thank you in advance for all of your issues, pull requests, and comments! ⭐

πŸ“Œ License

πŸ‘‰ About Rubrik Build

We encourage all contributors to become members. We aim to grow an active, healthy community of contributors, reviewers, and code owners. Learn more in our Welcome to the Rubrik Build Community page.

We'd love to hear from you! Email us: [email protected] πŸ’Œ

rubrik-sdk-for-python's People

Contributors

adameckerle avatar akasurde avatar damanin avatar draper1 avatar drew-russell avatar edoezie avatar eramnes avatar evcheng-rubrik avatar geluyan avatar jaapbrasser avatar janpillarrubrik avatar jayarep avatar king7997 avatar kowmangler avatar maka-rubrik avatar michaelcoyote avatar mo6020 avatar mwpreston avatar pcrouleur avatar promiseowolabi avatar qoutland avatar railroadmanuk avatar rfitzhugh avatar rzferchichi avatar shamsway avatar surendarchandra avatar vdingus avatar whocking avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

rubrik-sdk-for-python's Issues

Update Bootstrap for 5.0 API Change

Expected Behavior

NTP Configuration to be successfully applied during the bootstrap of a 5.0 Cluster

Current Behavior

The NTP Configuration does not apply.

Failure Information (for bugs)

Pre 5.0 /internal/cluster/{id}/bootstrap API config

  "ntpServers": [
    "string"
  ],

Post 5.0 config

"ntpServerConfigs": [
    {
      "server": "string",
      "symmetricKey": {
        "keyId": 0,
        "key": "string",
        "keyType": "string"
      }
    }
  ],

Physical Host deprecated search field in CDM 5.0+

Expected Behavior

Physical hosts return only 1 value when searching for the host id.

Current Behavior

If executed against a 5.0 Rubrik cluster, the physical host endpoint search criteria for hostname has been deprecated. This is currently used in the object_id function for searching physical hosts. Since its deprecated, we get all hosts returned when using physical_host as the object type.

Fix Information

We need a version check in the SDK to determine if we are 4.2- vs 5.0+

  • If this is Rubrik 4.2 or less, we need to use the hostname field
  • If this is Rubrik 5.0 or higher, we need to use the name field

Failure Information (for bugs)

Scripts requiring to use the physical host ID fail as they return more than 1 result

Steps to Reproduce

Use the object_type physical_host for any search query against a 5.0 cluster

data_management.py:

        elif object_type == 'physical_host':
            object_summary_api_version = 'v1'
            object_summary_api_endpoint = '/host?primary_cluster_id=local&hostname={}'.format(
                object_name)

Node Discovery for Bootstrap

Describe the solution you'd like

Before bootstrapping a Cluster we need to add the ability to validate all nodes are discoverable on the network via /cluster/{id}/discover before proceeding.

Additional context

We need to make sure we support Cloud Cluster bootstraps, which do not support IPv6 addresses, so it probably makes most sense to include this as a separate function (i.e don't build it into the Bootstrap function)

Add additional logic to bootstrap functions to prevent error when attempting to bootstrap a cloud cluster that was just created

Is your feature request related to a problem? Please describe.

When automatically creating a new Cloud Cluster (i.e through Ansible etc.) it takes a few minutes for services to come online after the initial boot so an error may potentially be returned. This error is usually related to tcp connections being denied.

Describe the solution you'd like

Add additional logic to the Bootstrap functions that will not error out when tcp (may be different for the requests module) or Unable to establish a connection during the first few minutes of boot. I'm not sure what the exact error message being returned would be. In the Go SDK it was always related to a "tcp" error so we were able to just look for that in the error.

Additional context

Go SDK code for the same functionality

numberOfAttempts := 0
for {
    numberOfAttempts++

    apiRequest, err := c.Get("internal", "/node_management/is_bootstrapped", httpTimeout)
    if err != nil {

        // Give the cluster 4 minutes to start responding to API calls before returning an error
        if strings.Contains(err.Error(), "tcp") {
            if numberOfAttempts == 24 {
                return false, err
            }
        } else if strings.Contains(err.Error(), "Unable to establish a connection") {

            if numberOfAttempts == 6 {
                fmt.Println("Attempts = 6 and error")
                return false, err
            }

        } else {
            return false, err

        }
    }

    if err == nil {
        return apiRequest.(map[string]interface{})["value"].(bool), nil
    }
    time.Sleep(10 * time.Second)

}

Floating IPs Function

Describe the solution you'd like

Add a function to configure Floating IPs on the Cluster. This may potentially be handled by the a bootstrap

Get SQL database live mounts

Is your feature request related to a problem? Please describe.

The only way to retrieve database live mounts is through the API or CDM. Developers will benefit from a python function to query the sql mount api based on instance name, hostname, clone name etc.

Describe the solution you'd like

Implement a function in data_management.py i.e. get_sql_live_mount

Need a function for SQL live mount and unmount

This is an enhancement feature request to appeal to database and python users.
This can be implemented in the existing Data Management class by adding functions specific to SQL related API's. Live mount as part of a test and dev workflow is a useful feature to have within the SDK.

Allow "/" at the end of the URL in certain situations

Expected Behavior

/fileset/snapshot/5c39cd8b-7ba9-4e19-8694-1ac17e238050/browse?path=/ should be a valid endpoint and not return an error

Current Behavior

What is the current behavior?

returns error saying / is not allowed at the end of a URL

On Demand DB Snapshots

Describe the solution you'd like

Add the ability to backup DBs using the on_demand_snapshot() function

Add feature to register rubrik agent

This is not related to a problem, this is purely a need for a new feature so we can, in an automated manner, register a VM.

Describe the solution you'd like

I've extended the SDK functionality to support registering a VM, along with some extra functionality around listing all vcenters and VMs for metadata gathering.

Describe alternatives you've considered

There are no alternative solutions

Proxy Settings Function

Describe the solution you'd like

Create a function to configure the Proxy settings on the Rubrik cluster

Additional context

API Documentation:

SDK does not install on CentOS 7.5 with Python 2.7.5

Trying to install on CentOS 7.5 with Python 2.7.5 but the package does not install. Works on the same system with Python 3.6.5.

Error:

[centos@ip-10-10-2-211 rubrik-sdk-for-python]$ more /etc/redhat-release
CentOS Linux release 7.5.1804 (Core)
[centos@ip-10-10-2-211 rubrik-sdk-for-python]$ python --version
Python 2.7.5

[centos@ip-10-10-2-211 rubrik-sdk-for-python]$ sudo python setup.py install
running install
running bdist_egg
running egg_info
writing UNKNOWN.egg-info/PKG-INFO
writing top-level names to UNKNOWN.egg-info/top_level.txt
writing dependency_links to UNKNOWN.egg-info/dependency_links.txt
reading manifest file 'UNKNOWN.egg-info/SOURCES.txt'
writing manifest file 'UNKNOWN.egg-info/SOURCES.txt'
installing library code to build/bdist.linux-x86_64/egg
running install_lib
creating build/bdist.linux-x86_64/egg
creating build/bdist.linux-x86_64/egg/rubrik
copying build/lib/rubrik/__init__.py -> build/bdist.linux-x86_64/egg/rubrik
copying build/lib/rubrik/api.py -> build/bdist.linux-x86_64/egg/rubrik
copying build/lib/rubrik/cluster.py -> build/bdist.linux-x86_64/egg/rubrik
copying build/lib/rubrik/rubrik.py -> build/bdist.linux-x86_64/egg/rubrik
byte-compiling build/bdist.linux-x86_64/egg/rubrik/__init__.py to __init__.pyc
byte-compiling build/bdist.linux-x86_64/egg/rubrik/api.py to api.pyc
byte-compiling build/bdist.linux-x86_64/egg/rubrik/cluster.py to cluster.pyc
byte-compiling build/bdist.linux-x86_64/egg/rubrik/rubrik.py to rubrik.pyc
creating build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/PKG-INFO -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/SOURCES.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/dependency_links.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
copying UNKNOWN.egg-info/top_level.txt -> build/bdist.linux-x86_64/egg/EGG-INFO
zip_safe flag not set; analyzing archive contents...
creating 'dist/UNKNOWN-0.0.0-py2.7.egg' and adding 'build/bdist.linux-x86_64/egg' to it
removing 'build/bdist.linux-x86_64/egg' (and everything under it)
Processing UNKNOWN-0.0.0-py2.7.egg
Removing /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
Copying UNKNOWN-0.0.0-py2.7.egg to /usr/lib/python2.7/site-packages
UNKNOWN 0.0.0 is already the active version in easy-install.pth

Installed /usr/lib/python2.7/site-packages/UNKNOWN-0.0.0-py2.7.egg
Processing dependencies for UNKNOWN==0.0.0
Finished processing dependencies for UNKNOWN==0.0.0
[centos@ip-10-10-2-211 rubrik-sdk-for-python]$

Create SLA Function

Describe the solution you'd like

Create a new function that will create new SLAs. The function, or potentially another function, should also have the ability to configure an archive location.

Support "config" values for delete API calls

Describe the solution you'd like

Add the ability to support "config" parameters when making delete API calls.

Additional context

/authorization/role/ endpoints require the ability to pass in config

Can't use get_sla_object with other SLA than the 3 defaults SLA

I have the 3 defaults SLA (Gold, Silver,Bronze) and on "Test" SLA

this following code works for the 3 defaults SLA :

print rubrik.get_sla_objects("Bronze","vmware")

but with the Test SLA i've got the following message :

Error: The sla object 'Test' was not found on the Rubrik cluster.

I've tried with an another SLA ...still the same message

Rubrik Edge version : 5.0.0-p2-1122

SDK 1.0.12 does not install on Ubuntu 18.04 with Python 3.6.7

Trying to install in a Docker container running Ubuntu 18.04 with Python 3.6.7 but the package does not install. It works perfectly with SDK version 1.0.11.

Error:

Collecting rubrik_cdm
  Downloading https://artifactory.test.lab:8443/artifactory/api/pypi/pypi/packages/a6/66/54064a3beedff2432aaf11ba4703ce9138f81a5a3a4450df48fbfa8c722d/rubrik_cdm-1.0.12.tar.gz
    Complete output from command python setup.py egg_info:
    Traceback (most recent call last):
      File "<string>", line 1, in <module>
      File "/tmp/pip-build-jqorcfbr/rubrik-cdm/setup.py", line 6, in <module>
        long_description = fh.read()
      File "/usr/lib/python3.6/encodings/ascii.py", line 26, in decode
        return codecs.ascii_decode(input, self.errors)[0]
    UnicodeDecodeError: 'ascii' codec can't decode byte 0xe2 in position 1132: ordinal not in range(128)

Add Windows SQL Host

Describe the solution you'd like

Create a new function that adds a new SQL Windows host to the Rubrik cluster

Additional context

Screen Shot 2019-03-28 at 10 57 17 AM

Psuedocode assignment operator in example

Example in docs/quick-start.md uses pseudocode assignment instead of standard python assignment (:= vs =).

Expected Behavior

Assignments as in doc will cause syntax error.

Current Behavior

What is the current behavior?

Failure Information (for bugs)

Please help provide information about the failure if this is a bug.

  • Use verbose outputs to capture any debug information.
Paste into a code block.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  • Use numbered list.

Context

Please provide any relevant information about your setup. This is important in case the issue is not reproducible except for under certain conditions.

  • Version of project.
  • Version of dependencies.
  • Version of operating system.

Failure Logs

Please include any relevant log snippets or files here.

  • Use verbose outputs to capture any debug information.
Paste into a code block.

Transition to IPv4 address after initial Bootstrap POST

Is your feature request related to a problem? Please describe.

When bootstrapping a physical cluster using the mDNS or IPv6 address we will run into the following error message when checking on the status of the bootstrap:

HTTPSConnectionPool(host='rvmhm188s013727.local', port=443): 
Max retries exceeded with url: /api/internal/cluster/me/bootstrap?request_id=1 
(Caused by NewConnectionError('<urllib3.connection.VerifiedHTTPSConnection 
object at 0x10b929048>: Failed to establish a new connection: [Errno 8] nodename 
nor servname provided, or not known'))

Describe the solution you'd like

Add logic that detects the user of a mDNS or IPv6 address for the initial connection and then transition to one of the provided IPv4 addresses for the wait_for_completion checks.

Multi tenancy support

Hi,

it seems that the current python SDK does not support organizations. So if a user is part of the global and annother organization the python SDK does not support this and throws an error 403.

Basically the python SDK should add the organization to the API request, like below:
api/v1/session?organization_id=Organization:::a7d40b13-b368-4af8-a67d-e32c75ff1cb5

Can this organization support be added to the module?

Marcel

Increase CloudOut Timeout values

What would you like to be added:

Increase the default timeout value for aws_s3_clodout and azure_cloudout

Why is this needed:

When adding a new archive location it may take longer than default 15 seconds to get a response from AWS/Azure which results in a timeout error message. The default timeout should be increased to a minimum of 3 minutes to account for this.

IPv6 bootstrap sometimes fails

Bootstrapping via IPv6 link-local multicast should work as expected

Please describe the behavior you are expecting.

Sometimes the interface scope needed to bootstrap an edge/cluster via IPv6 link-local multicast is not resolved, or resolves to 0, so bootstrapping fails

What is the current behavior?

If the IPv6 scope cannot be resolved, the bootstrap process fails.

Please help provide information about the failure if this is a bug.

  • Use verbose outputs to capture any debug information.
[2019-06-08 21:30:59,917] [DEBUG] -- User Provided Node IP: fe80::20c:29ff:fe99:77ed
[2019-06-08 21:30:59,917] [DEBUG] -- Resolved IPv6 address
[2019-06-08 21:30:59,918] [DEBUG] -- Resolved Node IP: [fe80::20c:29ff:fe99:77ed%0]
[2019-06-08 21:30:59,918] [DEBUG] -- bootstrap: Starting the bootstrap process.
[2019-06-08 21:30:59,918] [DEBUG] -- Created boostrap header: {'Host': '[fe80::20c:29ff:fe99:77ed]', 'Content-Type': 'application/json', 'Accept': 'application/json'}
[2019-06-08 21:30:59,919] [DEBUG] -- POST https://[fe80::20c:29ff:fe99:77ed%0]/api/internal/cluster/me/bootstrap
[2019-06-08 21:30:59,919] [DEBUG] -- Config: {"dnsSearchDomains": [], "enableSoftwareEncryptionAtRest": false, "name": "RubrikClusterName", "nodeConfigs": {"1": {"managementIpConfig": {"netmask": "255.255.255.0", "gateway": "10.0.2.254", "address": "10.0.2.12"}}}, "ntpServers": ["pool.ntp.org"], "dnsNameservers": ["8.8.8.8"], "adminUserInfo": {"password": "Welcome10!Rubrik", "emailAddress": "[email protected]", "id": "admin"}}
[2019-06-08 21:30:59,929] [DEBUG] -- bootstrap: Connection refused.
Traceback (most recent call last):
 File "rbk_bootstrap.py", line 22, in <module>
   setup_cluster = bootstrap.setup_cluster(cluster_name, admin_email, admin_password, management_gateway, management_subnet_mask, node_config, enable_encryption)
 File "/usr/local/lib/python2.7/dist-packages/rubrik_cdm/rubrik_cdm.py", line 399, in setup_cluster
   raise RubrikException(bootstrap_error)
rubrik_cdm.exceptions.RubrikException: Unable to establish a connection to the Rubrik cluster.

Steps to Reproduce

Please provide detailed steps for reproducing the issue.

  • Tested bootstrapping an edge on Ubuntu 18
  • Discovered bug/linux behavior of IPv6 scope resolving to 0

Should encode spaces in endpoint with + instead of %20

Currently the request URL is encoded with urllib.quote, which encodes spaces as %20. The browser encodes the same query with a plus instead. There is a function in python which does the same (urllib.quote_plus). The functionality seems the same, but the plus is way more readable.

return of the VM name after a live mount

Hello,
it would be great to be able to easily retrieve the name of the VM created after a snapshot live mount

Or in the rubrik.vsphere_live_mount , to be able to specify a vm name for the VM to be mounted

Issuing call where expected output us null results in error

I issued a call where the expected output us null. In this case, deleting all snapshots from a fileset. The SDK gave the following error:

2018-08-01 04:02:28 INFO Deleting snapshots for fileset Fileset:::e3dd8f2f-0493-44a8-847b-f548b43c9a8f...
Traceback (most recent call last):
File "purgerubrik.py", line 80, in
response = rubrik.delete('v1', '/fileset/{}/snapshot'.format(fileset['id']))
File "/usr/lib/python3.6/site-packages/rubrik-1.0-py3.6.egg/rubrik/api.py", line 208, in delete
File "/usr/lib/python3.6/site-packages/requests/models.py", line 896, in json
return complexjson.loads(self.text, **kwargs)
File "/usr/lib64/python3.6/json/init.py", line 354, in loads
return _default_decoder.decode(s)
File "/usr/lib64/python3.6/json/decoder.py", line 339, in decode
obj, end = self.raw_decode(s, idx=_w(s, 0).end())
File "/usr/lib64/python3.6/json/decoder.py", line 357, in raw_decode
raise JSONDecodeError("Expecting value", s, err.value) from None
json.decoder.JSONDecodeError: Expecting value: line 1 column 1 (char 0)
[centos@ip-10-10-2-211 ~]$

Bootstrap Error

Expected Behavior

Successfully complete a bootstrap.

Current Behavior

Bootstrap fails with the below error message.

Failure Information (for bugs)

Error: Error with cluster configuration parameters: java.lang.IllegalArgumentException: requirement failed: Failed to configure IPs for: VREC9A063CC25

Steps to Reproduce

Using a single node cloud cluster and Ansible. This could potentially be an Ansible specific issue but my initial thoughts are that its more SDK related

Ansible Playbook

 - rubrik_bootstrap:
        node_ip: "{{ bootstrap_node_ip }}"
        cluster_name: "{{ bootstrap_cluster_name }}"
        admin_email: "{{ bootstrap_admin_email }}"
        admin_password: "{{ bootstrap_admin_password }}"
        management_gateway: "{{ bootstrap_management_gateway }}"
        management_subnet_mask: "{{ bootstrap_management_subnet_mask }}"
        enable_encryption: "{{ bootstrap_enable_encryption }}"
        dns_search_domains: "{{ bootstrap_dns_search_domains }}"
        wait_for_completion: "{{ bootstrap_wait_for_completion }}"
        node_config: "{{ bootstrap_node_config }}"

Variables used

bootstrap_node_ip: ""
bootstrap_cluster_name: "Ansible Demo"
bootstrap_admin_email: ""
bootstrap_admin_password: ""
bootstrap_management_gateway: ""
bootstrap_management_subnet_mask: ""
bootstrap_enable_encryption: false
bootstrap_dns_search_domains: 
  - "rubrikansible.com"
bootstrap_wait_for_completion: True
bootstrap_node_config: 
    "1": ""

Context

rubrik-cdm 1.0.10

Add additional nodeConfig options for Bootstrap

Is your feature request related to a problem? Please describe.

We do not support the full nodeConfig options for physical node bootstraps.

Describe the solution you'd like

Add the support for ipmiIpConfig, dataIpConfig, and vlanIpConfigs fields in nodeConfig

"nodeConfigs": {
    "property1": {
        "managementIpConfig": {},
        "ipmiIpConfig": {
            "address": "string",
            "netmask": "string",
            "gateway": "string",
            "vlan": 0
        },
        "dataIpConfig": {
            "address": "string",
            "netmask": "string",
            "gateway": "string",
            "vlan": 0
        },
        "vlanIpConfigs": [
            {
                "vlan": 0,
                "ip": "string"
            }
        ]
    },

Creating Managed Volumes

Is your feature request related to a problem? Please describe.

Not a problem, more of an enhancement request:
Planning ahead for a customer using Oracle RMAN with Managed Volumes currently (4.2), I understand that we have to manually recreate Managed Volumes when we upgrade to 5.0. Understand this function is not available in the Python SDK yet.

A clear and concise description of what you want to happen.

Looking to script the process to create managed volumes and execute in one shot instead of manual creation from GUI.

Describe alternatives you've considered

Still in process to check whether we have ready made PoSH scripts too.

Allow for specifying Domain Display Name for password based authentication

Is your feature request related to a problem? Please describe.

In Rubrik CDM 5.0, if the Domain Display Name is not specified, then the Rubrik CDM will
first try the local domain before iterating through all the configured LDAP domains.
This can be slow and create many false alarms.

Describe the solution you'd like

An option to Connect() to specify the Domain Display Name.

Describe alternatives you've considered

There is no other way to specify an additional parameter using BASIC auth.

Additional context

Specifying Domain Display Name will generate an API token. This should also speed
up further API interactions, especially when using LDAP domain.

Add ability to pass dictionary of URL parameters

What would you like to be added:

Add the ability to pass a dictionary of parameters to the get, post, patch etc endpoints, rather than adding these to the URL.

Why is this needed:

Simpler than forming query strings in URL.

Errors and RubrikException when calling job_status()

Expected Behavior

Statuses such as FAILED and ACQUIRING (among others) are being returned by a few API calls (on demand snapshot, and instant recovery, etc.). These statuses should be handled by job_status().

Current Behavior

When there isFAILED status there is no progress value in the response which results in a KeyError due to the way line 311 is written (explained below).

Now, when the said line is fixed as suggested belowRubrikException() is raised because it appears that there are other "progress" statuses.

Failure Information (for bugs)

Line 311 of rubrik_cdm/api.py reads:

elif job_status == "QUEUED" or "RUNNING":

which does not look like the intended statement. Maybe what was intended was something like:

elif job_status in ["QUEUED" , "RUNNING"]:

Steps to Reproduce

For the KeyError: 'progress' (this is tricky because one needs something that causes the recovery to fail, we have seen permission errors on the VM and bad snapshot among others)

  1. Call response = vsphere_instant_recovery("vm")
  2. Call job_status(url) with url being response["links"][0]["href"]

For RubrikException():

  1. Change line 311 to look like suggested above
  2. Call _, url = on_demand_snapshot("vm", "vmware")
  3. Call job_status(url)
  4. Wait for a status that is not QUEUED or RUNNING

Context

  • version: current master branch (version 2.0.0 plus a few commits I believe)
  • scripts run from a Mac OSX environment with Python3, against enterprise deployed rubrik testing node.

Add support for IPv6 connections

Is your feature request related to a problem? Please describe.

Unable to bootstrap a cluster based off of its IPv6 address

Describe the solution you'd like

Add support for IPv6 management addresses in the SDK.

Additional context

Something similar to this should work. We need to allow for [] for the IP address which is how you populate IPv6 addresses in requests.

if call_type == 'GET':

    request_url = "https://{}/api/{}{}".format(

    self.node_ip, api_version, api_endpoint)

    request_url = quote(request_url, '://?=&').replace('%5B', '[').replace('%5D', ']')

    self.log('GET {}'.format(request_url))

Function Code Example does not support PEP8 formating

When auto-generating the documentation using create_docs.py the function_code_example (line 225) does not support multi-line function arguments that are PEP8 compliant.

for function, function_code_example in function_examples.items():
            if function_name is function:
                markdown.write('```py\n')
                markdown.write(function_code_example)
                markdown.write('\n```\n\n')

For example, the follow does not parse correctly,

def _common_api(
            self,
            call_type,
            api_version,
            api_endpoint,
            config=None,
            job_status_url=None,
            timeout=15,
            authentication=True):

The example will only show def _common_api(

Add refresh_vm function

Is your feature request related to a problem? Please describe.

Doing a full vCenter refresh can be time and resource intensive on VCSA when managing a very large VMware environment.

Describe the solution you'd like

Create a function to refresh a single VM's metadata using the following endpoint: /vmware/vcenter/{id}/refresh_vm

Describe alternatives you've considered

none

Additional context

n/a

assign_sla() overwrite direct vs derived

Is your feature request related to a problem? Please describe.

Allow assign_sla() to overwrite derived SLA assignments and make them direct instead

Additional context

customer request

SDK get should handle the hasMore case

Is your feature request related to a problem? Please describe.

The "problem" is more of a simplicity issue. One of the advantages of an SDK is that the library does the lower-level stuff for me. I consider the "hasMore" case to fall into that category

Describe the solution you'd like

I would like any call that does a get to check for the "hasMore" field. If that field exists and it is true, then the call should loop and continue to pull data using the given URL until the field is false. Be aware that not all get calls have this field so checking for that will be necessary.

Describe alternatives you've considered

Today, I must do this work manually. I have to check for the "hasMore" field or know that it's there, then I must check the field and then make subsequent calls if needed. While I can do that, it complicated my code and having the SDK calls do it would be MUCH cleaner.

Additional context

Feel free to follow up with any additional questions.

Location Function

Describe the solution you'd like

Add a function to configure the cluster location

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    πŸ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. πŸ“ŠπŸ“ˆπŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❀️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.