Skip to content

Latest commit

 

History

History
229 lines (168 loc) · 6.88 KB

FilesApi.md

File metadata and controls

229 lines (168 loc) · 6.88 KB

collibra_core.FilesApi

All URIs are relative to http://localhost/rest/2.0

Method HTTP request Description
add_files POST /files Upload files
get_file GET /files/{fileId} Download file
get_file_info GET /files/{fileId}/info Get file information

add_files

list[FileInfoImpl] add_files(file=file)

Upload files

Upload files

Example

  • Basic Authentication (basicAuth):
from __future__ import print_function
import time
import collibra_core
from collibra_core.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/rest/2.0
# See configuration.py for a list of all supported configuration parameters.
configuration = collibra_core.Configuration(
    host = "http://localhost/rest/2.0"
)

# 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 HTTP basic authorization: basicAuth
configuration = collibra_core.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with collibra_core.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = collibra_core.FilesApi(api_client)
    file = '/path/to/file' # file | File to upload (optional)

    try:
        # Upload files
        api_response = api_instance.add_files(file=file)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling FilesApi->add_files: %s\n" % e)

Parameters

Name Type Description Notes
file file File to upload [optional]

Return type

list[FileInfoImpl]

Authorization

basicAuth

HTTP request headers

  • Content-Type: multipart/form-data
  • Accept: application/json

HTTP response details

Status code Description Response headers
201 Files successfully uploaded. -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_file

get_file(file_id)

Download file

Downloads file identified by given id. Keep in mind to use GET /attachments/{attachmentId}/file instead of this endpoint when you want to get the file of an attachment. A File and its id can be temporary so it's possible this endpoint will not get you the desired file.

Example

  • Basic Authentication (basicAuth):
from __future__ import print_function
import time
import collibra_core
from collibra_core.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/rest/2.0
# See configuration.py for a list of all supported configuration parameters.
configuration = collibra_core.Configuration(
    host = "http://localhost/rest/2.0"
)

# 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 HTTP basic authorization: basicAuth
configuration = collibra_core.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with collibra_core.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = collibra_core.FilesApi(api_client)
    file_id = 'file_id_example' # str | the id of the file

    try:
        # Download file
        api_instance.get_file(file_id)
    except ApiException as e:
        print("Exception when calling FilesApi->get_file: %s\n" % e)

Parameters

Name Type Description Notes
file_id str the id of the file

Return type

void (empty response body)

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: Not defined

HTTP response details

Status code Description Response headers
200 The found file -

[Back to top] [Back to API list] [Back to Model list] [Back to README]

get_file_info

ScopeImpl get_file_info(file_id)

Get file information

Returns information about the file identified by given id.

Example

  • Basic Authentication (basicAuth):
from __future__ import print_function
import time
import collibra_core
from collibra_core.rest import ApiException
from pprint import pprint
# Defining the host is optional and defaults to http://localhost/rest/2.0
# See configuration.py for a list of all supported configuration parameters.
configuration = collibra_core.Configuration(
    host = "http://localhost/rest/2.0"
)

# 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 HTTP basic authorization: basicAuth
configuration = collibra_core.Configuration(
    username = 'YOUR_USERNAME',
    password = 'YOUR_PASSWORD'
)

# Enter a context with an instance of the API client
with collibra_core.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = collibra_core.FilesApi(api_client)
    file_id = 'file_id_example' # str | the id of the file

    try:
        # Get file information
        api_response = api_instance.get_file_info(file_id)
        pprint(api_response)
    except ApiException as e:
        print("Exception when calling FilesApi->get_file_info: %s\n" % e)

Parameters

Name Type Description Notes
file_id str the id of the file

Return type

ScopeImpl

Authorization

basicAuth

HTTP request headers

  • Content-Type: Not defined
  • Accept: application/json

HTTP response details

Status code Description Response headers
200 The file information -

[Back to top] [Back to API list] [Back to Model list] [Back to README]