Skip to content

Latest commit

 

History

History
554 lines (410 loc) · 18.1 KB

RelationshipsApi.md

File metadata and controls

554 lines (410 loc) · 18.1 KB

pyjama.RelationshipsApi

All URIs are relative to http://<jama_endpoint>/rest/latest

Method HTTP request Description
clear_suspect_link DELETE /relationships/{relationshipId}/suspect Remove an existing suspect link for the relationship with the specified ID
create_relationship POST /relationships Create a new relationship
delete_relationship DELETE /relationships/{relationshipId} Delete the relationship with the specified ID
get_relationship GET /relationships/{relationshipId} Get the relationship with the specified ID
get_relationships GET /relationships Get all relationships in the project with the specified ID
update_relationship PUT /relationships/{relationshipId} Update the relationship with the specified ID

clear_suspect_link

AbstractRestResponse clear_suspect_link(relationship_id)

Remove an existing suspect link for the relationship with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.abstract_rest_response import AbstractRestResponse
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    relationship_id = 1 # int | 

    # example passing only required values which don't have defaults set
    try:
        # Remove an existing suspect link for the relationship with the specified ID
        api_response = api_instance.clear_suspect_link(relationship_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->clear_suspect_link: %s\n" % e)

Parameters

Name Type Description Notes
relationship_id int

Return type

AbstractRestResponse

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

create_relationship

CreatedResponse create_relationship(body)

Create a new relationship

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.created_response import CreatedResponse
from pyjama.model.request_relationship import RequestRelationship
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    body = RequestRelationship(
        from_item=1,
        to_item=1,
        relationship_type=1,
    ) # RequestRelationship | 

    # example passing only required values which don't have defaults set
    try:
        # Create a new relationship
        api_response = api_instance.create_relationship(body)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->create_relationship: %s\n" % e)

Parameters

Name Type Description Notes
body RequestRelationship

Return type

CreatedResponse

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

delete_relationship

AbstractRestResponse delete_relationship(relationship_id)

Delete the relationship with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.abstract_rest_response import AbstractRestResponse
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    relationship_id = 1 # int | 

    # example passing only required values which don't have defaults set
    try:
        # Delete the relationship with the specified ID
        api_response = api_instance.delete_relationship(relationship_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->delete_relationship: %s\n" % e)

Parameters

Name Type Description Notes
relationship_id int

Return type

AbstractRestResponse

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

get_relationship

RelationshipDataWrapper get_relationship(relationship_id)

Get the relationship with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.relationship_data_wrapper import RelationshipDataWrapper
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    relationship_id = 1 # int | 
    include = [
        "include_example",
    ] # [str] | Links to include as full objects in the linked map (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get the relationship with the specified ID
        api_response = api_instance.get_relationship(relationship_id)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->get_relationship: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get the relationship with the specified ID
        api_response = api_instance.get_relationship(relationship_id, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->get_relationship: %s\n" % e)

Parameters

Name Type Description Notes
relationship_id int
include [str] Links to include as full objects in the linked map [optional]

Return type

RelationshipDataWrapper

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

get_relationships

RelationshipDataListWrapper get_relationships(project)

Get all relationships in the project with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.relationship_data_list_wrapper import RelationshipDataListWrapper
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    project = 1 # int | 
    start_at = 1 # int |  (optional)
    max_results = 1 # int | If not set, this defaults to 20. This cannot be larger than 50 (optional)
    include = [
        "include_example",
    ] # [str] | Links to include as full objects in the linked map (optional)

    # example passing only required values which don't have defaults set
    try:
        # Get all relationships in the project with the specified ID
        api_response = api_instance.get_relationships(project)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->get_relationships: %s\n" % e)

    # example passing only required values which don't have defaults set
    # and optional values
    try:
        # Get all relationships in the project with the specified ID
        api_response = api_instance.get_relationships(project, start_at=start_at, max_results=max_results, include=include)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->get_relationships: %s\n" % e)

Parameters

Name Type Description Notes
project int
start_at int [optional]
max_results int If not set, this defaults to 20. This cannot be larger than 50 [optional]
include [str] Links to include as full objects in the linked map [optional]

Return type

RelationshipDataListWrapper

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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

update_relationship

AbstractRestResponse update_relationship(relationship_id, body)

Update the relationship with the specified ID

Example

  • Basic Authentication (basic):
  • OAuth Authentication (oauth2):
import time
import pyjama
from pyjama.api import relationships_api
from pyjama.model.request_relationship import RequestRelationship
from pyjama.model.abstract_rest_response import AbstractRestResponse
from pprint import pprint
# Defining the host is optional and defaults to http://<jama_endpoint>/rest/latest
# See configuration.py for a list of all supported configuration parameters.
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)

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

# Configure OAuth2 access token for authorization: oauth2
configuration = pyjama.Configuration(
    host = "http://<jama_endpoint>/rest/latest"
)
configuration.access_token = 'YOUR_ACCESS_TOKEN'

# Enter a context with an instance of the API client
with pyjama.ApiClient(configuration) as api_client:
    # Create an instance of the API class
    api_instance = relationships_api.RelationshipsApi(api_client)
    relationship_id = 1 # int | 
    body = RequestRelationship(
        from_item=1,
        to_item=1,
        relationship_type=1,
    ) # RequestRelationship | 

    # example passing only required values which don't have defaults set
    try:
        # Update the relationship with the specified ID
        api_response = api_instance.update_relationship(relationship_id, body)
        pprint(api_response)
    except pyjama.ApiException as e:
        print("Exception when calling RelationshipsApi->update_relationship: %s\n" % e)

Parameters

Name Type Description Notes
relationship_id int
body RequestRelationship

Return type

AbstractRestResponse

Authorization

basic, oauth2

HTTP request headers

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

HTTP response details

Status code Description Response headers
200 successful operation -

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