netorca-sdk


Namenetorca-sdk JSON
Version 0.1.22 PyPI version JSON
download
home_pagehttps://gitlab.com/netorca_public/netorca_sdk/
SummaryA package for interacting with the NetOrca API
upload_time2024-04-02 08:53:06
maintainerNone
docs_urlNone
authorScott Rowlandson
requires_pythonNone
licenseMIT
keywords netorca orchestration netautomate
VCS
bugtrack_url
requirements No requirements were recorded.
Travis-CI No Travis.
coveralls test coverage No coveralls.
            Netorca SDK
===========

The NetOrca SDK is a powerful tool that allows developers to seamlessly
integrate and interact with the NetOrca API, simplifying the management
of various aspects of the NetOrca platform. This documentation provides
comprehensive guidance on using the SDK to access NetOrca’s features and
data.

Overview
--------

The NetOrca SDK offers a set of Python classes and methods that
facilitate communication with the NetOrca API. It provides an
abstraction layer for authentication, making API calls, and handling
responses, enabling developers to focus on building applications and
services that leverage NetOrca’s capabilities.

Prerequisites
-------------

Before using this code, ensure you have the following:

-  NetOrca API Key: You’ll need an API key to authenticate with the
   NetOrca API.
-  URL: The URL for the NetOrca API.
-  Python Environment: Make sure you have Python installed on your
   system.

Installation
------------

First, you need to install the NetOrca SDK if you haven’t already. You
can install it using pip:

.. code:: bash

   pip install netorca-sdk

Sample Code
-----------

Create an Instance of Netorca
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

The NetOrca SDK works with either the use of an API key or a username
and password. After creating the Netorca instance, you can utilize the
supported methods as shown in the examples below. Each method supports
various parameters and filters to customize the requests and responses.
You can refer to the `NetOrca API
documentation <https://docs.netorca.io/api_guide/api/>`__ for more
details on the available endpoints and parameters.

.. code:: python

   # Import necessary modules
   import os
   from netorca_sdk.auth import NetorcaAuth
   from netorca_sdk.netorca import Netorca

   # Initialize the authentication object with your API key and API URL
   netorca_auth = NetorcaAuth(api_key=os.environ["api_key"], fqdn=os.environ["url"])

   # Create an instance of the Netorca class with the authentication object
   netorca = Netorca(auth=netorca_auth)

   # Define filters to narrow down the search
   filters = {"service_name": "name_of_the_service"}

   # Retrieve information about services using the defined filters
   services_info = netorca.get_services(filters=filters)

   # Print the result
   print(services_info)

Using NetOrca with username and password
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Import necessary modules
   import os
   from netorca_sdk.auth import NetorcaAuth
   from netorca_sdk.netorca import Netorca

   # Initialize the authentication object with your API key and API URL
   netorca_auth = NetorcaAuth(username="VALID_USERNAME", password="VALID_PASSWORD", fqdn=os.environ["url"])

   # Create an instance of the Netorca class with the authentication object
   netorca = Netorca(auth=netorca_auth)

   # Define filters to narrow down the search
   filters = {"service_name": "name_of_the_service"}

   # Retrieve information about services using the defined filters
   services_info = netorca.get_services(filters=filters)

   # Print the result
   print(services_info)

Get Services
~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of services with optional filters
   filters = {"service_name": "some_name"} 
   result = netorca.get_services(filters)
   print("Services:", result)

Get Service Items
~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of service items with optional filters
   filters = {"service_name": "some_service_name"}  
   result = netorca.get_service_items(filters)
   print("Service Items:", result)

Get Service Item by ID
~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve information about a specific service item by its ID
   service_item_id = 789  # Replace with the actual service item ID
   result = netorca.get_service_item(service_item_id)
   print("Service Item Information:", result)

Get Change Instances
~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of change instances with optional filters
   filters = {"service_name": "some_service_name"}  # Replace with desired filters, or set to None to get all change instances
   result = netorca.get_change_instances(filters)
   print("Change Instances:", result)

Get Change Instance by ID
~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve information about a specific change instance by its ID
   change_instance_id = 1234  # Replace with the actual change instance ID
   result = netorca.get_change_instance(change_instance_id)
   print("Change Instance:", result)

Get Service Configs
~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of service configs with optional filters
   filters = {"service_name": "some_service_name"}  # Replace with desired filters, or set to None to get all service configs
   result = netorca.get_service_configs(filters)
   print("Service Configs:", result)

Get Service Config by ID
~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve information about a specific service config by its ID
   service_config_id = 9012  # Replace with the actual service config ID
   result = netorca.get_service_config(service_config_id)
   print("Service Config Information:", result)

Get Deployed Items
~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of deployed items with optional filters
   filters = {"service_id": 555}  # Replace with desired filters, or set to None to get all deployed items
   result = netorca.get_deployed_items(filters)
   print("Deployed Items:", result)

Get Deployed Item by ID
~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve information about a specific deployed item by its ID
   deployed_item_id = 456  # Replace with the actual deployed item ID
   result = netorca.get_deployed_item(deployed_item_id)
   print("Deployed Item Information:", result)

Create Deployed Item
~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Create a new deployed item associated with a change instance
   change_instance_id = 123  # Replace with the actual change instance ID
   description = {
     "data": "some_data"
   }
   result = netorca.create_deployed_item(change_instance_id, description)
   print("Created Deployed Item:", result)

Update Change Instance
~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Update information of a specific change instance by its ID
   change_instance_id = 5678  # Replace with the actual change instance ID
   update_data = {"state": "APPROVED"} 
   result = netorca.update_change_instance(change_instance_id, update_data)
   print("Updated Change Instance:", result)

Create Service Config
~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Create a new service config with the provided data
   config_data = {
       "config": {
           "config1":"test1", 
           "config2":"test2"
       }, 
       "service":1
   } 
   result = netorca.create_service_config(config_data)
   print("Created Service Config:", result)

Get Service Items Dependant
~~~~~~~~~~~~~~~~~~~~~~~~~~~

.. code:: python

   # Retrieve a list of service item dependants with optional filters
   filters = {"service_name": "some_service"}  
   result = netorca.get_service_items_dependant(filters)
   print("Service Items Dependant:", result)

Get Charges
~~~~~~~~~~~

.. code:: python

   # Retrieve a list of charges with optional filters
   filters = {"charge_type": "monthly_cost"} 
   result = netorca.get_charges(filters)
   print("Charges:", result)

Update Charges
~~~~~~~~~~~~~~

.. code:: python

   # Update information of a specific charge by its ID
   data = { "processed": True }
   result = netorca.caller("charges", "patch", id="123", data=data)
   print("Updated Charges:", result)

Replace the placeholder values in each example with the actual data or
IDs you want to use in your interactions with the Netorca API. These
examples demonstrate how to use the various functions provided by the
``Netorca`` class to perform different operations.

Submission Examples
-------------------

NetOrca Support two types of submission, Consumer and ServiceOwner. We
use these on the CI/CD pipeline to submit changes to the NetOrca API.

Consumer submission
~~~~~~~~~~~~~~~~~~~

In this example ConsumerSubmission will look for configuration in the
``config.yaml`` file. The ``config.yaml`` file should be in the same
directory as the script. Example of ``config.yaml`` file:

.. code:: yaml

   ---

   netorca_global:
     base_url: https://api.example-netorca-url.com/v1
     metadata:
       budget_code: 12345
       team_name: name_of_the_team
       team_email: user@mail.com

.. code:: python

   # Import necessary modules
   from netorca_sdk.netorca import ConsumerSubmission

   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter
   consumer = ConsumerSubmission(api_key="API_KEY")
   # Set the NetOrca API URL
   consumer.load_from_repository(REPOSITORY_URL)
   result = consumer.submit()
   # Show the result
   print("Task Submission Result:", result)

Consumer submission with use_config
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We should pass config parameter to the load_from_repository as a
dictionary instead of ``config.yaml`` file.

.. code:: python

   # Import necessary modules
   from netorca_sdk.netorca import ConsumerSubmission

   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter
   consumer = ConsumerSubmission(api_key="API_KEY", use_config=True)
   config = {
     "netorca_global": {
       "base_url": "https://api.example-netorca-url.com/v1",
       "metadata": {
         "budget_code": 12345,
         "team_name": "name_of_the_team",
         "team_email": "user@email.com"
       }
     }
   }
   # We can use netorca_validate_only to validate the changes without submitting them
   consumer.load_from_repository(REPOSITORY_URL, netorca_validate_only=True, repository_config=config)
   result = consumer.submit()
   # Show the result
   print("Task Submission Result:", result)

ServiceOwner submission
~~~~~~~~~~~~~~~~~~~~~~~

In this example ServiceOwnerSubmission will look for configuration in
the ``config.yaml`` file. The ``config.yaml`` file should be under
``.netorca`` directory in the same directory of script.

.. code:: python

   # Import necessary modules
   from netorca_sdk.netorca import ServiceOwnerSubmission

   # Create an instance of ConsumerSubmission
   service_owner = ServiceOwnerSubmission(api_key="API_KEY")
   # Set the repository base directory
   REPOSITORY_URL = os.environ.get("REPOSITORY_URL", "./")
   service_owner.load_from_repository(REPOSITORY_URL)
   result = service_owner.submit()
   # Show the result
   print("Task Submission Result:", result)

ServiceOwner submission with extra configs
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~

We can also pass extra configuration such as the NetOrca directory or
pass configuration instead of using the ``config.json`` file.

.. code:: python

   # Import necessary modules
   from netorca_sdk.netorca import ServiceOwnerSubmission

   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter
   service_owner = ServiceOwnerSubmission(api_key="API_KEY")
   # Set the repository base directory
   REPOSITORY_URL = os.environ.get("REPOSITORY_URL", "./")
   config = {
     "netorca_global": {
       "base_url": "https://api.example-netorca-url.com/v1"
     }
   }
   service_owner.load_from_repository(REPOSITORY_URL, netorca_directory="netorca", repository_config=config)
   result = service_owner.submit()
   # Show the result
   print("Task Submission Result:", result)

\```python

Usage
-----

1. Replace ``"api_key_here"`` and ``"api_url_here"`` in the code with
   your actual API key and API URL.

2. Run the Python script to execute the code. It will make a request to
   the Netorca API and retrieve information about services that match
   the specified filters.

3. The result will be printed to the console.

Additional Information
----------------------

-  You can customize the ``filters`` dictionary to filter services based
   on your requirements.

-  For more advanced usage, consider setting the ``use_config``
   parameter to ``True`` when creating an instance of
   ``ConsumerSubmission``. When ``use_config`` is set to ``True``, the
   SDK will search for the ``team_name`` in the ``config.yaml`` file. If
   ``use_config`` is set to ``False`` (the default), the SDK will call
   the API with your token to dynamically retrieve the ``team_name``.

-  For more details on available API endpoints and methods, refer to the
   NetOrca API documentation.

-  Ensure you have the necessary environment variables set for the API
   key and URL before running the code.

Updates
-------

This SDK will aim to always be released in line with the latest NetOrca
version but does not provide any guarantees.

License
-------

This code is provided under the `MIT License <LICENSE>`__.

            

Raw data

            {
    "_id": null,
    "home_page": "https://gitlab.com/netorca_public/netorca_sdk/",
    "name": "netorca-sdk",
    "maintainer": null,
    "docs_url": null,
    "requires_python": null,
    "maintainer_email": null,
    "keywords": "netorca, orchestration, netautomate",
    "author": "Scott Rowlandson",
    "author_email": "scott@netautomate.org",
    "download_url": "https://files.pythonhosted.org/packages/56/34/2ba81cb3b13d0d19e6c7af1b1a80e48c50398c2e18292b72c1e9d2c01c69/netorca-sdk-0.1.22.tar.gz",
    "platform": null,
    "description": "Netorca SDK\n===========\n\nThe NetOrca SDK is a powerful tool that allows developers to seamlessly\nintegrate and interact with the NetOrca API, simplifying the management\nof various aspects of the NetOrca platform. This documentation provides\ncomprehensive guidance on using the SDK to access NetOrca\u2019s features and\ndata.\n\nOverview\n--------\n\nThe NetOrca SDK offers a set of Python classes and methods that\nfacilitate communication with the NetOrca API. It provides an\nabstraction layer for authentication, making API calls, and handling\nresponses, enabling developers to focus on building applications and\nservices that leverage NetOrca\u2019s capabilities.\n\nPrerequisites\n-------------\n\nBefore using this code, ensure you have the following:\n\n-  NetOrca API Key: You\u2019ll need an API key to authenticate with the\n   NetOrca API.\n-  URL: The URL for the NetOrca API.\n-  Python Environment: Make sure you have Python installed on your\n   system.\n\nInstallation\n------------\n\nFirst, you need to install the NetOrca SDK if you haven\u2019t already. You\ncan install it using pip:\n\n.. code:: bash\n\n   pip install netorca-sdk\n\nSample Code\n-----------\n\nCreate an Instance of Netorca\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nThe NetOrca SDK works with either the use of an API key or a username\nand password. After creating the Netorca instance, you can utilize the\nsupported methods as shown in the examples below. Each method supports\nvarious parameters and filters to customize the requests and responses.\nYou can refer to the `NetOrca API\ndocumentation <https://docs.netorca.io/api_guide/api/>`__ for more\ndetails on the available endpoints and parameters.\n\n.. code:: python\n\n   # Import necessary modules\n   import os\n   from netorca_sdk.auth import NetorcaAuth\n   from netorca_sdk.netorca import Netorca\n\n   # Initialize the authentication object with your API key and API URL\n   netorca_auth = NetorcaAuth(api_key=os.environ[\"api_key\"], fqdn=os.environ[\"url\"])\n\n   # Create an instance of the Netorca class with the authentication object\n   netorca = Netorca(auth=netorca_auth)\n\n   # Define filters to narrow down the search\n   filters = {\"service_name\": \"name_of_the_service\"}\n\n   # Retrieve information about services using the defined filters\n   services_info = netorca.get_services(filters=filters)\n\n   # Print the result\n   print(services_info)\n\nUsing NetOrca with username and password\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Import necessary modules\n   import os\n   from netorca_sdk.auth import NetorcaAuth\n   from netorca_sdk.netorca import Netorca\n\n   # Initialize the authentication object with your API key and API URL\n   netorca_auth = NetorcaAuth(username=\"VALID_USERNAME\", password=\"VALID_PASSWORD\", fqdn=os.environ[\"url\"])\n\n   # Create an instance of the Netorca class with the authentication object\n   netorca = Netorca(auth=netorca_auth)\n\n   # Define filters to narrow down the search\n   filters = {\"service_name\": \"name_of_the_service\"}\n\n   # Retrieve information about services using the defined filters\n   services_info = netorca.get_services(filters=filters)\n\n   # Print the result\n   print(services_info)\n\nGet Services\n~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of services with optional filters\n   filters = {\"service_name\": \"some_name\"} \n   result = netorca.get_services(filters)\n   print(\"Services:\", result)\n\nGet Service Items\n~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of service items with optional filters\n   filters = {\"service_name\": \"some_service_name\"}  \n   result = netorca.get_service_items(filters)\n   print(\"Service Items:\", result)\n\nGet Service Item by ID\n~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve information about a specific service item by its ID\n   service_item_id = 789  # Replace with the actual service item ID\n   result = netorca.get_service_item(service_item_id)\n   print(\"Service Item Information:\", result)\n\nGet Change Instances\n~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of change instances with optional filters\n   filters = {\"service_name\": \"some_service_name\"}  # Replace with desired filters, or set to None to get all change instances\n   result = netorca.get_change_instances(filters)\n   print(\"Change Instances:\", result)\n\nGet Change Instance by ID\n~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve information about a specific change instance by its ID\n   change_instance_id = 1234  # Replace with the actual change instance ID\n   result = netorca.get_change_instance(change_instance_id)\n   print(\"Change Instance:\", result)\n\nGet Service Configs\n~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of service configs with optional filters\n   filters = {\"service_name\": \"some_service_name\"}  # Replace with desired filters, or set to None to get all service configs\n   result = netorca.get_service_configs(filters)\n   print(\"Service Configs:\", result)\n\nGet Service Config by ID\n~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve information about a specific service config by its ID\n   service_config_id = 9012  # Replace with the actual service config ID\n   result = netorca.get_service_config(service_config_id)\n   print(\"Service Config Information:\", result)\n\nGet Deployed Items\n~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of deployed items with optional filters\n   filters = {\"service_id\": 555}  # Replace with desired filters, or set to None to get all deployed items\n   result = netorca.get_deployed_items(filters)\n   print(\"Deployed Items:\", result)\n\nGet Deployed Item by ID\n~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve information about a specific deployed item by its ID\n   deployed_item_id = 456  # Replace with the actual deployed item ID\n   result = netorca.get_deployed_item(deployed_item_id)\n   print(\"Deployed Item Information:\", result)\n\nCreate Deployed Item\n~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Create a new deployed item associated with a change instance\n   change_instance_id = 123  # Replace with the actual change instance ID\n   description = {\n     \"data\": \"some_data\"\n   }\n   result = netorca.create_deployed_item(change_instance_id, description)\n   print(\"Created Deployed Item:\", result)\n\nUpdate Change Instance\n~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Update information of a specific change instance by its ID\n   change_instance_id = 5678  # Replace with the actual change instance ID\n   update_data = {\"state\": \"APPROVED\"} \n   result = netorca.update_change_instance(change_instance_id, update_data)\n   print(\"Updated Change Instance:\", result)\n\nCreate Service Config\n~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Create a new service config with the provided data\n   config_data = {\n       \"config\": {\n           \"config1\":\"test1\", \n           \"config2\":\"test2\"\n       }, \n       \"service\":1\n   } \n   result = netorca.create_service_config(config_data)\n   print(\"Created Service Config:\", result)\n\nGet Service Items Dependant\n~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of service item dependants with optional filters\n   filters = {\"service_name\": \"some_service\"}  \n   result = netorca.get_service_items_dependant(filters)\n   print(\"Service Items Dependant:\", result)\n\nGet Charges\n~~~~~~~~~~~\n\n.. code:: python\n\n   # Retrieve a list of charges with optional filters\n   filters = {\"charge_type\": \"monthly_cost\"} \n   result = netorca.get_charges(filters)\n   print(\"Charges:\", result)\n\nUpdate Charges\n~~~~~~~~~~~~~~\n\n.. code:: python\n\n   # Update information of a specific charge by its ID\n   data = { \"processed\": True }\n   result = netorca.caller(\"charges\", \"patch\", id=\"123\", data=data)\n   print(\"Updated Charges:\", result)\n\nReplace the placeholder values in each example with the actual data or\nIDs you want to use in your interactions with the Netorca API. These\nexamples demonstrate how to use the various functions provided by the\n``Netorca`` class to perform different operations.\n\nSubmission Examples\n-------------------\n\nNetOrca Support two types of submission, Consumer and ServiceOwner. We\nuse these on the CI/CD pipeline to submit changes to the NetOrca API.\n\nConsumer submission\n~~~~~~~~~~~~~~~~~~~\n\nIn this example ConsumerSubmission will look for configuration in the\n``config.yaml`` file. The ``config.yaml`` file should be in the same\ndirectory as the script. Example of ``config.yaml`` file:\n\n.. code:: yaml\n\n   ---\n\n   netorca_global:\n     base_url: https://api.example-netorca-url.com/v1\n     metadata:\n       budget_code: 12345\n       team_name: name_of_the_team\n       team_email: user@mail.com\n\n.. code:: python\n\n   # Import necessary modules\n   from netorca_sdk.netorca import ConsumerSubmission\n\n   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter\n   consumer = ConsumerSubmission(api_key=\"API_KEY\")\n   # Set the NetOrca API URL\n   consumer.load_from_repository(REPOSITORY_URL)\n   result = consumer.submit()\n   # Show the result\n   print(\"Task Submission Result:\", result)\n\nConsumer submission with use_config\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nWe should pass config parameter to the load_from_repository as a\ndictionary instead of ``config.yaml`` file.\n\n.. code:: python\n\n   # Import necessary modules\n   from netorca_sdk.netorca import ConsumerSubmission\n\n   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter\n   consumer = ConsumerSubmission(api_key=\"API_KEY\", use_config=True)\n   config = {\n     \"netorca_global\": {\n       \"base_url\": \"https://api.example-netorca-url.com/v1\",\n       \"metadata\": {\n         \"budget_code\": 12345,\n         \"team_name\": \"name_of_the_team\",\n         \"team_email\": \"user@email.com\"\n       }\n     }\n   }\n   # We can use netorca_validate_only to validate the changes without submitting them\n   consumer.load_from_repository(REPOSITORY_URL, netorca_validate_only=True, repository_config=config)\n   result = consumer.submit()\n   # Show the result\n   print(\"Task Submission Result:\", result)\n\nServiceOwner submission\n~~~~~~~~~~~~~~~~~~~~~~~\n\nIn this example ServiceOwnerSubmission will look for configuration in\nthe ``config.yaml`` file. The ``config.yaml`` file should be under\n``.netorca`` directory in the same directory of script.\n\n.. code:: python\n\n   # Import necessary modules\n   from netorca_sdk.netorca import ServiceOwnerSubmission\n\n   # Create an instance of ConsumerSubmission\n   service_owner = ServiceOwnerSubmission(api_key=\"API_KEY\")\n   # Set the repository base directory\n   REPOSITORY_URL = os.environ.get(\"REPOSITORY_URL\", \"./\")\n   service_owner.load_from_repository(REPOSITORY_URL)\n   result = service_owner.submit()\n   # Show the result\n   print(\"Task Submission Result:\", result)\n\nServiceOwner submission with extra configs\n~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~\n\nWe can also pass extra configuration such as the NetOrca directory or\npass configuration instead of using the ``config.json`` file.\n\n.. code:: python\n\n   # Import necessary modules\n   from netorca_sdk.netorca import ServiceOwnerSubmission\n\n   # Create an instance of ConsumerSubmission with the authentication object and use_config parameter\n   service_owner = ServiceOwnerSubmission(api_key=\"API_KEY\")\n   # Set the repository base directory\n   REPOSITORY_URL = os.environ.get(\"REPOSITORY_URL\", \"./\")\n   config = {\n     \"netorca_global\": {\n       \"base_url\": \"https://api.example-netorca-url.com/v1\"\n     }\n   }\n   service_owner.load_from_repository(REPOSITORY_URL, netorca_directory=\"netorca\", repository_config=config)\n   result = service_owner.submit()\n   # Show the result\n   print(\"Task Submission Result:\", result)\n\n\\```python\n\nUsage\n-----\n\n1. Replace ``\"api_key_here\"`` and ``\"api_url_here\"`` in the code with\n   your actual API key and API URL.\n\n2. Run the Python script to execute the code. It will make a request to\n   the Netorca API and retrieve information about services that match\n   the specified filters.\n\n3. The result will be printed to the console.\n\nAdditional Information\n----------------------\n\n-  You can customize the ``filters`` dictionary to filter services based\n   on your requirements.\n\n-  For more advanced usage, consider setting the ``use_config``\n   parameter to ``True`` when creating an instance of\n   ``ConsumerSubmission``. When ``use_config`` is set to ``True``, the\n   SDK will search for the ``team_name`` in the ``config.yaml`` file. If\n   ``use_config`` is set to ``False`` (the default), the SDK will call\n   the API with your token to dynamically retrieve the ``team_name``.\n\n-  For more details on available API endpoints and methods, refer to the\n   NetOrca API documentation.\n\n-  Ensure you have the necessary environment variables set for the API\n   key and URL before running the code.\n\nUpdates\n-------\n\nThis SDK will aim to always be released in line with the latest NetOrca\nversion but does not provide any guarantees.\n\nLicense\n-------\n\nThis code is provided under the `MIT License <LICENSE>`__.\n",
    "bugtrack_url": null,
    "license": "MIT",
    "summary": "A package for interacting with the NetOrca API",
    "version": "0.1.22",
    "project_urls": {
        "Homepage": "https://gitlab.com/netorca_public/netorca_sdk/"
    },
    "split_keywords": [
        "netorca",
        " orchestration",
        " netautomate"
    ],
    "urls": [
        {
            "comment_text": "",
            "digests": {
                "blake2b_256": "56342ba81cb3b13d0d19e6c7af1b1a80e48c50398c2e18292b72c1e9d2c01c69",
                "md5": "3bfb7876b1bc70e3ef8ef500cbc8f1c6",
                "sha256": "e180eebc5982b99e81beace5a96a2bbf2050639bf6d5808db4ac5ad06599cea7"
            },
            "downloads": -1,
            "filename": "netorca-sdk-0.1.22.tar.gz",
            "has_sig": false,
            "md5_digest": "3bfb7876b1bc70e3ef8ef500cbc8f1c6",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": null,
            "size": 24042,
            "upload_time": "2024-04-02T08:53:06",
            "upload_time_iso_8601": "2024-04-02T08:53:06.468735Z",
            "url": "https://files.pythonhosted.org/packages/56/34/2ba81cb3b13d0d19e6c7af1b1a80e48c50398c2e18292b72c1e9d2c01c69/netorca-sdk-0.1.22.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2024-04-02 08:53:06",
    "github": false,
    "gitlab": true,
    "bitbucket": false,
    "codeberg": false,
    "gitlab_user": "netorca_public",
    "gitlab_project": "netorca_sdk",
    "lcname": "netorca-sdk"
}
        
Elapsed time: 1.06540s