Skip to content

Latest commit

 

History

History
311 lines (232 loc) · 13.8 KB

File metadata and controls

311 lines (232 loc) · 13.8 KB

AttachmentProperty

Method HTTP request Release Stage
get_attachment GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property} Stable
get_attachment_by_rid GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid} Stable
read_attachment GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/content Stable
read_attachment_by_rid GET /v2/ontologies/{ontology}/objects/{objectType}/{primaryKey}/attachments/{property}/{attachmentRid}/content Stable

get_attachment

Get the metadata of attachments parented to the given object.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
artifact_repository Optional[ArtifactRepositoryRid] The repository associated with a marketplace installation. [optional]
package_name Optional[SdkPackageName] The package name of the generated SDK. [optional]

Return type

AttachmentMetadataResponse

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**.
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[ArtifactRepositoryRid] | The repository associated with a marketplace installation.
artifact_repository = None
# Optional[SdkPackageName] | The package name of the generated SDK.
package_name = None


try:
    api_response = client.ontologies.AttachmentProperty.get_attachment(
        ontology,
        object_type,
        primary_key,
        property,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The get_attachment response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.get_attachment: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AttachmentMetadataResponse Success response. application/json

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

get_attachment_by_rid

Get the metadata of a particular attachment in an attachment list.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
attachment_rid AttachmentRid The RID of the attachment.
artifact_repository Optional[ArtifactRepositoryRid] The repository associated with a marketplace installation. [optional]
package_name Optional[SdkPackageName] The package name of the generated SDK. [optional]

Return type

AttachmentV2

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**.
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
# Optional[ArtifactRepositoryRid] | The repository associated with a marketplace installation.
artifact_repository = None
# Optional[SdkPackageName] | The package name of the generated SDK.
package_name = None


try:
    api_response = client.ontologies.AttachmentProperty.get_attachment_by_rid(
        ontology,
        object_type,
        primary_key,
        property,
        attachment_rid,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The get_attachment_by_rid response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.get_attachment_by_rid: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 AttachmentV2 Success response. application/json

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

read_attachment

Get the content of an attachment.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
artifact_repository Optional[ArtifactRepositoryRid] The repository associated with a marketplace installation. [optional]
package_name Optional[SdkPackageName] The package name of the generated SDK. [optional]

Return type

bytes

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**.
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# Optional[ArtifactRepositoryRid] | The repository associated with a marketplace installation.
artifact_repository = None
# Optional[SdkPackageName] | The package name of the generated SDK.
package_name = None


try:
    api_response = client.ontologies.AttachmentProperty.read_attachment(
        ontology,
        object_type,
        primary_key,
        property,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The read_attachment response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.read_attachment: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 bytes Success response. /

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

read_attachment_by_rid

Get the content of an attachment by its RID.

The RID must exist in the attachment array of the property.

Third-party applications using this endpoint via OAuth2 must request the following operation scopes: api:ontologies-read.

Parameters

Name Type Description Notes
ontology OntologyIdentifier The API name of the ontology. To find the API name, use the List ontologies endpoint or check the Ontology Manager.
object_type ObjectTypeApiName The API name of the object type. To find the API name, use the List object types endpoint or check the Ontology Manager.
primary_key PropertyValueEscapedString The primary key of the object containing the attachment.
property PropertyApiName The API name of the attachment property. To find the API name for your attachment, check the Ontology Manager or use the Get object type endpoint.
attachment_rid AttachmentRid The RID of the attachment.
artifact_repository Optional[ArtifactRepositoryRid] The repository associated with a marketplace installation. [optional]
package_name Optional[SdkPackageName] The package name of the generated SDK. [optional]

Return type

bytes

Example

from foundry_sdk import FoundryClient
import foundry_sdk
from pprint import pprint

client = FoundryClient(auth=foundry_sdk.UserTokenAuth(...), hostname="example.palantirfoundry.com")

# OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**.
ontology = "palantir"
# ObjectTypeApiName | The API name of the object type. To find the API name, use the **List object types** endpoint or check the **Ontology Manager**.
object_type = "employee"
# PropertyValueEscapedString | The primary key of the object containing the attachment.
primary_key = 50030
# PropertyApiName | The API name of the attachment property. To find the API name for your attachment, check the **Ontology Manager** or use the **Get object type** endpoint.
property = "performance"
# AttachmentRid | The RID of the attachment.
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
# Optional[ArtifactRepositoryRid] | The repository associated with a marketplace installation.
artifact_repository = None
# Optional[SdkPackageName] | The package name of the generated SDK.
package_name = None


try:
    api_response = client.ontologies.AttachmentProperty.read_attachment_by_rid(
        ontology,
        object_type,
        primary_key,
        property,
        attachment_rid,
        artifact_repository=artifact_repository,
        package_name=package_name,
    )
    print("The read_attachment_by_rid response:\n")
    pprint(api_response)
except foundry_sdk.PalantirRPCException as e:
    print("HTTP error when calling AttachmentProperty.read_attachment_by_rid: %s\n" % e)

Authorization

See README

HTTP response details

Status Code Type Description Content Type
200 bytes Success response. /

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