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 |
POST /vardok-migration/{vardok-id} |
Create a variable definition from a VarDok variable definition. |
|
DraftVariableDefinitionsApi |
POST /variable-definitions |
Create a variable definition. |
|
DraftVariableDefinitionsApi |
DELETE /variable-definitions/{variable-definition-id} |
Delete a variable definition. |
|
DraftVariableDefinitionsApi |
PATCH /variable-definitions/{variable-definition-id} |
Update a variable definition. |
|
PatchesApi |
POST /variable-definitions/{variable-definition-id}/patches |
Create a new patch for a variable definition. |
|
PatchesApi |
GET /variable-definitions/{variable-definition-id}/patches |
List all patches for the given variable definition. |
|
PatchesApi |
GET /variable-definitions/{variable-definition-id}/patches/{patch-id} |
Get one concrete patch for the given variable definition. |
|
PublicApi |
GET /public/variable-definitions/{variable-definition-id} |
Get one variable definition. |
|
PublicApi |
GET /public/variable-definitions/{variable-definition-id}/validity-periods |
List all validity periods. |
|
PublicApi |
GET /public/variable-definitions |
List all variable definitions. |
|
ValidityPeriodsApi |
POST /variable-definitions/{variable-definition-id}/validity-periods |
Create a new validity period for a variable definition. |
|
ValidityPeriodsApi |
GET /public/variable-definitions/{variable-definition-id}/validity-periods |
List all validity periods. |
|
ValidityPeriodsApi |
GET /variable-definitions/{variable-definition-id}/validity-periods |
List all validity periods. |
|
VariableDefinitionsApi |
GET /public/variable-definitions/{variable-definition-id} |
Get one variable definition. |
|
VariableDefinitionsApi |
GET /variable-definitions/{variable-definition-id} |
Get one variable definition. |
|
VariableDefinitionsApi |
GET /public/variable-definitions |
List all variable definitions. |
|
VariableDefinitionsApi |
GET /variable-definitions |
List all variable definitions. |