Skip to content

Commit 4ac23d3

Browse files
Excavator: Upgrade API Version (#165)
1 parent f34b3dc commit 4ac23d3

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

47 files changed

+4127
-31
lines changed

README.md

Lines changed: 30 additions & 0 deletions
Large diffs are not rendered by default.
Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ContentLength
2+
3+
ContentLength
4+
5+
## Type
6+
```python
7+
Long
8+
```
9+
10+
11+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v1/Core/models/ContentType.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# ContentType
2+
3+
ContentType
4+
5+
## Type
6+
```python
7+
str
8+
```
9+
10+
11+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v1/Core/models/Filename.md

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,12 @@
1+
# Filename
2+
3+
The name of a File within Foundry. Examples: `my-file.txt`, `my-file.jpg`, `dataframe.snappy.parquet`.
4+
5+
6+
## Type
7+
```python
8+
str
9+
```
10+
11+
12+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v1/Core/models/MediaType.md

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
# MediaType
2+
3+
The [media type](https://www.iana.org/assignments/media-types/media-types.xhtml) of the file or attachment.
4+
Examples: `application/json`, `application/pdf`, `application/octet-stream`, `image/jpeg`
5+
6+
7+
## Type
8+
```python
9+
str
10+
```
11+
12+
13+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v1/Core/models/SizeBytes.md

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,11 @@
1+
# SizeBytes
2+
3+
The size of the file or attachment in bytes.
4+
5+
## Type
6+
```python
7+
Long
8+
```
9+
10+
11+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v1/Ontologies/Attachment.md

Lines changed: 189 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,189 @@
1+
# Attachment
2+
3+
Method | HTTP request | Release Stage |
4+
------------- | ------------- | ----- |
5+
[**get**](#get) | **GET** /v1/attachments/{attachmentRid} | Stable |
6+
[**read**](#read) | **GET** /v1/attachments/{attachmentRid}/content | Stable |
7+
[**upload**](#upload) | **POST** /v1/attachments/upload | Stable |
8+
9+
# **get**
10+
Get the metadata of an attachment.
11+
12+
Third-party applications using this endpoint via OAuth2 must request the
13+
following operation scopes: `api:ontologies-read`.
14+
15+
16+
### Parameters
17+
18+
Name | Type | Description | Notes |
19+
------------- | ------------- | ------------- | ------------- |
20+
**attachment_rid** | AttachmentRid | The RID of the attachment. | |
21+
22+
### Return type
23+
**Attachment**
24+
25+
### Example
26+
27+
```python
28+
from foundry.v1 import FoundryClient
29+
import foundry
30+
from pprint import pprint
31+
32+
foundry_client = FoundryClient(
33+
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
34+
)
35+
36+
# AttachmentRid | The RID of the attachment.
37+
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
38+
39+
40+
try:
41+
api_response = foundry_client.ontologies.Attachment.get(
42+
attachment_rid,
43+
)
44+
print("The get response:\n")
45+
pprint(api_response)
46+
except foundry.PalantirRPCException as e:
47+
print("HTTP error when calling Attachment.get: %s\n" % e)
48+
49+
```
50+
51+
52+
53+
### Authorization
54+
55+
See [README](../../../README.md#authorization)
56+
57+
### HTTP response details
58+
| Status Code | Type | Description | Content Type |
59+
|-------------|-------------|-------------|------------------|
60+
**200** | Attachment | Success response. | application/json |
61+
62+
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v1-link) [[Back to Model list]](../../../README.md#models-v1-link) [[Back to README]](../../../README.md)
63+
64+
# **read**
65+
Get the content of an attachment.
66+
67+
Third-party applications using this endpoint via OAuth2 must request the
68+
following operation scopes: `api:ontologies-read`.
69+
70+
71+
### Parameters
72+
73+
Name | Type | Description | Notes |
74+
------------- | ------------- | ------------- | ------------- |
75+
**attachment_rid** | AttachmentRid | The RID of the attachment. | |
76+
77+
### Return type
78+
**bytes**
79+
80+
### Example
81+
82+
```python
83+
from foundry.v1 import FoundryClient
84+
import foundry
85+
from pprint import pprint
86+
87+
foundry_client = FoundryClient(
88+
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
89+
)
90+
91+
# AttachmentRid | The RID of the attachment.
92+
attachment_rid = "ri.attachments.main.attachment.bb32154e-e043-4b00-9461-93136ca96b6f"
93+
94+
95+
try:
96+
api_response = foundry_client.ontologies.Attachment.read(
97+
attachment_rid,
98+
)
99+
print("The read response:\n")
100+
pprint(api_response)
101+
except foundry.PalantirRPCException as e:
102+
print("HTTP error when calling Attachment.read: %s\n" % e)
103+
104+
```
105+
106+
107+
108+
### Authorization
109+
110+
See [README](../../../README.md#authorization)
111+
112+
### HTTP response details
113+
| Status Code | Type | Description | Content Type |
114+
|-------------|-------------|-------------|------------------|
115+
**200** | bytes | Success response. | */* |
116+
117+
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v1-link) [[Back to Model list]](../../../README.md#models-v1-link) [[Back to README]](../../../README.md)
118+
119+
# **upload**
120+
Upload an attachment to use in an action. Any attachment which has not been linked to an object via
121+
an action within one hour after upload will be removed.
122+
Previously mapped attachments which are not connected to any object anymore are also removed on
123+
a biweekly basis.
124+
The body of the request must contain the binary content of the file and the `Content-Type` header must be `application/octet-stream`.
125+
126+
Third-party applications using this endpoint via OAuth2 must request the
127+
following operation scopes: `api:ontologies-write`.
128+
129+
130+
### Parameters
131+
132+
Name | Type | Description | Notes |
133+
------------- | ------------- | ------------- | ------------- |
134+
**body** | bytes | Body of the request | |
135+
**content_length** | ContentLength | The size in bytes of the file content being uploaded. | |
136+
**content_type** | ContentType | The media type of the file being uploaded. | |
137+
**filename** | Filename | The name of the file being uploaded. | |
138+
139+
### Return type
140+
**Attachment**
141+
142+
### Example
143+
144+
```python
145+
from foundry.v1 import FoundryClient
146+
import foundry
147+
from pprint import pprint
148+
149+
foundry_client = FoundryClient(
150+
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
151+
)
152+
153+
# bytes | Body of the request
154+
body = None
155+
# ContentLength | The size in bytes of the file content being uploaded.
156+
content_length = None
157+
# ContentType | The media type of the file being uploaded.
158+
content_type = None
159+
# Filename | The name of the file being uploaded.
160+
filename = "My Image.jpeg"
161+
162+
163+
try:
164+
api_response = foundry_client.ontologies.Attachment.upload(
165+
body,
166+
content_length=content_length,
167+
content_type=content_type,
168+
filename=filename,
169+
)
170+
print("The upload response:\n")
171+
pprint(api_response)
172+
except foundry.PalantirRPCException as e:
173+
print("HTTP error when calling Attachment.upload: %s\n" % e)
174+
175+
```
176+
177+
178+
179+
### Authorization
180+
181+
See [README](../../../README.md#authorization)
182+
183+
### HTTP response details
184+
| Status Code | Type | Description | Content Type |
185+
|-------------|-------------|-------------|------------------|
186+
**200** | Attachment | Success response. | application/json |
187+
188+
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v1-link) [[Back to Model list]](../../../README.md#models-v1-link) [[Back to README]](../../../README.md)
189+
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# Attachment
2+
3+
The representation of an attachment.
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**rid** | AttachmentRid | Yes | |
9+
**filename** | Filename | Yes | |
10+
**size_bytes** | SizeBytes | Yes | |
11+
**media_type** | MediaType | Yes | |
12+
13+
14+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)
Lines changed: 14 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,14 @@
1+
# AttachmentDict
2+
3+
The representation of an attachment.
4+
5+
## Properties
6+
| Name | Type | Required | Description |
7+
| ------------ | ------------- | ------------- | ------------- |
8+
**rid** | AttachmentRid | Yes | |
9+
**filename** | Filename | Yes | |
10+
**sizeBytes** | SizeBytes | Yes | |
11+
**mediaType** | MediaType | Yes | |
12+
13+
14+
[[Back to Model list]](../../../../README.md#models-v1-link) [[Back to API list]](../../../../README.md#apis-v1-link) [[Back to README]](../../../../README.md)

docs/v2/Ontologies/ActionType.md

Lines changed: 59 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -3,6 +3,7 @@
33
Method | HTTP request | Release Stage |
44
------------- | ------------- | ----- |
55
[**get**](#get) | **GET** /v2/ontologies/{ontology}/actionTypes/{actionType} | Stable |
6+
[**get_by_rid**](#get_by_rid) | **GET** /v2/ontologies/{ontology}/actionTypes/byRid/{actionTypeRid} | Stable |
67
[**list**](#list) | **GET** /v2/ontologies/{ontology}/actionTypes | Stable |
78
[**page**](#page) | **GET** /v2/ontologies/{ontology}/actionTypes | Stable |
89

@@ -53,6 +54,64 @@ except foundry.PalantirRPCException as e:
5354

5455

5556

57+
### Authorization
58+
59+
See [README](../../../README.md#authorization)
60+
61+
### HTTP response details
62+
| Status Code | Type | Description | Content Type |
63+
|-------------|-------------|-------------|------------------|
64+
**200** | ActionTypeV2 | Success response. | application/json |
65+
66+
[[Back to top]](#) [[Back to API list]](../../../README.md#apis-v2-link) [[Back to Model list]](../../../README.md#models-v2-link) [[Back to README]](../../../README.md)
67+
68+
# **get_by_rid**
69+
Gets a specific action type with the given RID.
70+
71+
Third-party applications using this endpoint via OAuth2 must request the following operation scope: `api:ontologies-read`.
72+
73+
74+
### Parameters
75+
76+
Name | Type | Description | Notes |
77+
------------- | ------------- | ------------- | ------------- |
78+
**ontology** | OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**. | |
79+
**action_type_rid** | ActionTypeRid | The RID of the action type. | |
80+
81+
### Return type
82+
**ActionTypeV2**
83+
84+
### Example
85+
86+
```python
87+
from foundry.v2 import FoundryClient
88+
import foundry
89+
from pprint import pprint
90+
91+
foundry_client = FoundryClient(
92+
auth=foundry.UserTokenAuth(...), hostname="example.palantirfoundry.com"
93+
)
94+
95+
# OntologyIdentifier | The API name of the ontology. To find the API name, use the **List ontologies** endpoint or check the **Ontology Manager**.
96+
ontology = "palantir"
97+
# ActionTypeRid | The RID of the action type.
98+
action_type_rid = "ri.ontology.main.action-type.7ed72754-7491-428a-bb18-4d7296eb2167"
99+
100+
101+
try:
102+
api_response = foundry_client.ontologies.Ontology.ActionType.get_by_rid(
103+
ontology,
104+
action_type_rid,
105+
)
106+
print("The get_by_rid response:\n")
107+
pprint(api_response)
108+
except foundry.PalantirRPCException as e:
109+
print("HTTP error when calling ActionType.get_by_rid: %s\n" % e)
110+
111+
```
112+
113+
114+
56115
### Authorization
57116

58117
See [README](../../../README.md#authorization)

0 commit comments

Comments
 (0)