{ "info": { "author": "ansible-dellemc-unity", "author_email": "mityushin.dmitry@gmail.com", "bugtrack_url": null, "classifiers": [ "License :: OSI Approved :: MIT License", "Operating System :: OS Independent", "Programming Language :: Python" ], "description": "# Readme\n\nA python module to execute [ansible-dellemc-unity](https://github.com/ansible-dellemc-unity/ansible-dellemc-unity) (Ansible modules for DellEMC Unity).\n\nThis SDK provides common functions for all Ansible modules and special interface to communicate with Unity.\n\n## How to install this SDK\n\nYou have several ways to install this SDK\n\n##### Install from pip repo\n``pip install dellemc-unity-sdk``\n\n##### Install from source\n\n git clone https://github.com/ansible-dellemc-unity/dellemc-unity-sdk.git\n cd dellemc-unity-sdk\n python setup.py sdist\n sudo pip install dist/dellemc_unity_sdk.xxxx.tar.gz\n\n##### Install from source var2\n\n git clone https://github.com/ansible-dellemc-unity/dellemc-unity-sdk.git\n cd dellemc-unity-sdk\n python setup.py sdist bdist_wheel\n sudo pip install dist/dellemc_unity_sdk-XXXX-pyY-none-any.whl \n\n## How to write modules\n\nAccording to our experience and [issue #4](https://github.com/ansible-dellemc-unity/dellemc-unity-sdk/issues/4) , \nyou should create an instance of AnsibleModule in your module. So to create you should argument_spec use:\n\n``supportive_functions.create_arguments_for_ansible_module(array_of_dictionaries)`` or \n``supportive_functions.create_arguments_for_ansible_module(template)``\n\nAfter that make an instance of AnsibleModule and put it next to template into\n\n``runner.run(ansible_module, template)``\n\nYour module will be automatically executed by SDK.\n\n## How to write templates for runner.run(...)\n\ntemplate is a dictionary that should have following keys:\n\n1. ``constants.REST_OBJECT = 'rest_object'`` value of this key should be a REST object\n2. ``constants.ACTIONS = 'actions'`` value of this key should be a dictionary of actions,\nfor example, {'create:{...}', 'delete':{...},...}\n\nTo execute actions automatically dictionary of action should have following parameters:\n\n1. ``constants.ACTION_TYPE`` value of this key should be ``constants.ActionType.UPDATE`` or ``constants.ActionType.QUERY``\n2. ``constants.PARAMETER_TYPES = 'parameter_types'`` value of this key should be a dictionary that should have keys:\n'required' and 'optional' and value of each key should be iterable.\n\nFor example:\n\n {\n constants.REST_OBJECT: 'pool',\n constants.ACTIONS: {\n 'delete':\n {constants.ACTION_TYPE: constants.ActionType.UPDATE,\n constants.PARAMETER_TYPES: parameters_all.get('delete')}\n }\n }\n\n### Optional parameters (keys) for template\n\n1. ``constants.REST_OBJECT_FOR_GET_REQUEST`` use this key for making GET request to REST\n object that is different from ``constants.REST_OBJECT``\n\n### Optional parameters (keys) for dictionary of actions\n\n1. ``constants.DO_ACTION = 'do action'`` use this constant if you want the parameter name in the playbook to \nbe different from the one in the REST model. For example,\n\n {\n constants.REST_OBJECT: 'lun',\n constants.ACTIONS: {\n 'create':\n {\n constants.ACTION_TYPE: constants.ActionType.UPDATE,\n constants.PARAMETER_TYPES: parameters_all.get('create'),\n constants.DO_ACTION: \"\n }\n }\n } \n\n### How to write type of parameters for validator\n\nIt should be a dictionary that can be written in two ways\n\n#### Option with type of arguments\n\n {\n \"required_argument_var1\" : dict(required=True, type=, default=),\n \"required_argument_var2\" : dict(required=True),\n \"optional_argument\": dict(required=False),\n \"optional_argument_var_2\": dict()... \n }\n\nyou can skip some keys in dictionary, by default it will be \n``dict(required=False, type=None, default=None)``\n\n**supported types of arguments**:\n\n* _None_ - validator doesn't check type of this argument\n* _dict_ - validator expect type dictionary\n* _object_ - same as dict\n* _bool_\n* _int_\n* _str_\n* _list_\n* any others python's object\n* supported enums from dellemc_unity_sdk.rest_supported_enums\n\n#### Option with keys (easy way)\n\nDictionary should have keys: \"required\" and \"optional\". For example: \n\n {\n 'required': {'type', 'name'},\n 'optional': {'description','osType','tenant'},\n }\n\n## How to execute custom functions\n\nIf your request can't be made by functions ``runner.do_update_request(...)`` or ``runner.do_query_request(...)`` you can\nexecute your own function by using key ``constants.EXECUTED_BY = 'executed_by'``\n\nFor example:\n\n {\n constants.REST_OBJECT: 'pool',\n constants.ACTIONS: {'create': {constants.EXECUTED_BY: function}}\n }\n\nYour function should have 2 parameters (parameters, unity). parameters = parameters from *.yml file, \nunity = instance of class Unity and also function must have return statement, \nthat will be add to output in parameter ``'output'``\n\n## Additional information\n\nAll REST objects have action _\"get\"_ (``constants.GET``), that sends GET requests, you are allowed to redefine this action \n\n\n\n\n", "description_content_type": "", "docs_url": null, "download_url": "", "downloads": { "last_day": -1, "last_month": -1, "last_week": -1 }, "home_page": "https://github.com/ansible-dellemc-unity/dellemc-unity-sdk", "keywords": "", "license": "", "maintainer": "", "maintainer_email": "", "name": "dellemc-unity-sdk", "package_url": "https://pypi.org/project/dellemc-unity-sdk/", "platform": "", "project_url": "https://pypi.org/project/dellemc-unity-sdk/", "project_urls": { "Homepage": "https://github.com/ansible-dellemc-unity/dellemc-unity-sdk" }, "release_url": "https://pypi.org/project/dellemc-unity-sdk/1.0/", "requires_dist": [ "dellemc-unity-sdk" ], "requires_python": "", "summary": "Package used to create requests to DellEMC Unity.", "version": "1.0" }, "last_serial": 4100605, "releases": { "1.0": [ { "comment_text": "", "digests": { "md5": "16c92fe649d3516853744816b0089854", "sha256": "330a2353938db2c3e71a33baa3343faf3fe436868ca3707ae9529d2f0ecc6e11" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "16c92fe649d3516853744816b0089854", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13936, "upload_time": "2018-07-25T13:34:40", "url": "https://files.pythonhosted.org/packages/4f/7e/8c5919df4e4bb511f764244b4d5e6e81663bf356df2b5faf4ed8bd1f5581/dellemc_unity_sdk-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8bea5d416d090a2aa5d3169c69ee577", "sha256": "ebba4f6eafe4a2e1447933a12525f6effcf7e81f964c6ce51660a7cf8b4f429f" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8bea5d416d090a2aa5d3169c69ee577", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13936, "upload_time": "2018-07-25T13:19:30", "url": "https://files.pythonhosted.org/packages/95/73/c30b443897f945005273a450375d7676bb8f0a18e79f54437d00ec03c396/dellemc_unity_sdk-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "715b36755d9e6013eb9d20f02d2ec71d", "sha256": "af6a8e0538d3d44fd9e10d4fecf4334138e1bea2fdb54d5decedcd9be5e533a0" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0.tar.gz", "has_sig": false, "md5_digest": "715b36755d9e6013eb9d20f02d2ec71d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10201, "upload_time": "2018-07-25T13:19:32", "url": "https://files.pythonhosted.org/packages/03/8f/86b98af7e04488dee6444934869bd944448eb23eb13fe6610da303b35f5c/dellemc_unity_sdk-1.0.tar.gz" } ] }, "urls": [ { "comment_text": "", "digests": { "md5": "16c92fe649d3516853744816b0089854", "sha256": "330a2353938db2c3e71a33baa3343faf3fe436868ca3707ae9529d2f0ecc6e11" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0-py2-none-any.whl", "has_sig": false, "md5_digest": "16c92fe649d3516853744816b0089854", "packagetype": "bdist_wheel", "python_version": "py2", "requires_python": null, "size": 13936, "upload_time": "2018-07-25T13:34:40", "url": "https://files.pythonhosted.org/packages/4f/7e/8c5919df4e4bb511f764244b4d5e6e81663bf356df2b5faf4ed8bd1f5581/dellemc_unity_sdk-1.0-py2-none-any.whl" }, { "comment_text": "", "digests": { "md5": "e8bea5d416d090a2aa5d3169c69ee577", "sha256": "ebba4f6eafe4a2e1447933a12525f6effcf7e81f964c6ce51660a7cf8b4f429f" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0-py3-none-any.whl", "has_sig": false, "md5_digest": "e8bea5d416d090a2aa5d3169c69ee577", "packagetype": "bdist_wheel", "python_version": "py3", "requires_python": null, "size": 13936, "upload_time": "2018-07-25T13:19:30", "url": "https://files.pythonhosted.org/packages/95/73/c30b443897f945005273a450375d7676bb8f0a18e79f54437d00ec03c396/dellemc_unity_sdk-1.0-py3-none-any.whl" }, { "comment_text": "", "digests": { "md5": "715b36755d9e6013eb9d20f02d2ec71d", "sha256": "af6a8e0538d3d44fd9e10d4fecf4334138e1bea2fdb54d5decedcd9be5e533a0" }, "downloads": -1, "filename": "dellemc_unity_sdk-1.0.tar.gz", "has_sig": false, "md5_digest": "715b36755d9e6013eb9d20f02d2ec71d", "packagetype": "sdist", "python_version": "source", "requires_python": null, "size": 10201, "upload_time": "2018-07-25T13:19:32", "url": "https://files.pythonhosted.org/packages/03/8f/86b98af7e04488dee6444934869bd944448eb23eb13fe6610da303b35f5c/dellemc_unity_sdk-1.0.tar.gz" } ] }