vardef-client

No description provided (generated by Openapi Generator https://github.com/openapitools/openapi-generator)

This Python package is automatically generated by the OpenAPI Generator project:

  • API version: 0.1

  • Package version: 1.0.0

  • Generator version: 7.9.0

  • Build package: org.openapitools.codegen.languages.PythonClientCodegen

Requirements

Python 3.7+

Installation & Usage

pip install

If the python package is hosted on a repository, you can install directly using:

pip install git+https://github.com/statisticsnorway/dapla-toolbelt-metadata.git

(you may need to run pip with root permission: sudo pip install git+https://github.com/statisticsnorway/dapla-toolbelt-metadata.git)

Then import the package:

import vardef_client

Setuptools

Install via Setuptools.

python setup.py install --user

(or sudo python setup.py install to install the package for all users)

Then import the package:

import vardef_client

Tests

Execute pytest to run the tests.

Getting Started

Please follow the installation procedure and then run the following:


import vardef_client
from vardef_client.rest import ApiException
from pprint import pprint

# Defining the host is optional and defaults to https://metadata.intern.test.ssb.no
# See configuration.py for a list of all supported configuration parameters.
configuration = vardef_client.Configuration(
    host = "https://metadata.intern.test.ssb.no"
)

# The client must configure the authentication and authorization parameters
# in accordance with the API server security policy.
# Examples for each auth method are provided below, use the example that
# satisfies your auth use case.

# Configure Bearer authorization (JWT): Keycloak token
configuration = vardef_client.Configuration(
    access_token = os.environ["BEARER_TOKEN"]
)


# Enter a context with an instance of the API client
with vardef_client.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = vardef_client.DataMigrationApi(api_client)
    vardok_id = '1607' # str | The ID of the definition in Vardok.
    active_group = 'dapla-felles-developers' # str | The group which the user currently represents.

    try:
        # Create a variable definition from a VarDok variable definition.
        api_response = api_instance.create_variable_definition_from_var_dok(vardok_id, active_group)
        print("The response of DataMigrationApi->create_variable_definition_from_var_dok:\n")
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling DataMigrationApi->create_variable_definition_from_var_dok: %s\n" % e)

Documentation for API Endpoints

All URIs are relative to https://metadata.intern.test.ssb.no

Class

Method

HTTP request

Description

DataMigrationApi

create_variable_definition_from_var_dok

POST /vardok-migration/{vardok-id}

Create a variable definition from a VarDok variable definition.

DraftVariableDefinitionsApi

create_variable_definition

POST /variable-definitions

Create a variable definition.

DraftVariableDefinitionsApi

delete_variable_definition_by_id

DELETE /variable-definitions/{variable-definition-id}

Delete a variable definition.

DraftVariableDefinitionsApi

update_variable_definition_by_id

PATCH /variable-definitions/{variable-definition-id}

Update a variable definition.

PatchesApi

create_patch

POST /variable-definitions/{variable-definition-id}/patches

Create a new patch for a variable definition.

PatchesApi

get_all_patches

GET /variable-definitions/{variable-definition-id}/patches

List all patches for the given variable definition.

PatchesApi

get_one_patch

GET /variable-definitions/{variable-definition-id}/patches/{patch-id}

Get one concrete patch for the given variable definition.

PublicApi

get_public_variable_definition_by_id

GET /public/variable-definitions/{variable-definition-id}

Get one variable definition.

PublicApi

list_public_validity_periods

GET /public/variable-definitions/{variable-definition-id}/validity-periods

List all validity periods.

PublicApi

list_public_variable_definitions

GET /public/variable-definitions

List all variable definitions.

ValidityPeriodsApi

create_validity_period

POST /variable-definitions/{variable-definition-id}/validity-periods

Create a new validity period for a variable definition.

ValidityPeriodsApi

list_public_validity_periods_0

GET /public/variable-definitions/{variable-definition-id}/validity-periods

List all validity periods.

ValidityPeriodsApi

list_validity_periods

GET /variable-definitions/{variable-definition-id}/validity-periods

List all validity periods.

VariableDefinitionsApi

get_public_variable_definition_by_id_0

GET /public/variable-definitions/{variable-definition-id}

Get one variable definition.

VariableDefinitionsApi

get_variable_definition_by_id

GET /variable-definitions/{variable-definition-id}

Get one variable definition.

VariableDefinitionsApi

list_public_variable_definitions_0

GET /public/variable-definitions

List all variable definitions.

VariableDefinitionsApi

list_variable_definitions

GET /variable-definitions

List all variable definitions.

Documentation For Models

Documentation For Authorization

Authentication schemes defined for the API:

Keycloak token

  • Type: Bearer authentication (JWT)

Author

metadata@ssb.no