java/resources/containers/methods/retrieve/index.md +0 −130 deleted
File Deleted View Diff
1## Retrieve container
2
3`ContainerRetrieveResponse containers().retrieve(ContainerRetrieveParamsparams = ContainerRetrieveParams.none(), RequestOptionsrequestOptions = RequestOptions.none())`
4
5**get** `/containers/{container_id}`
6
7Retrieve Container
8
9### Parameters
10
11- `ContainerRetrieveParams params`
12
13 - `Optional<String> containerId`
14
15### Returns
16
17- `class ContainerRetrieveResponse:`
18
19 - `String id`
20
21 Unique identifier for the container.
22
23 - `long createdAt`
24
25 Unix timestamp (in seconds) when the container was created.
26
27 - `String name`
28
29 Name of the container.
30
31 - `String object_`
32
33 The type of this object.
34
35 - `String status`
36
37 Status of the container (e.g., active, deleted).
38
39 - `Optional<ExpiresAfter> expiresAfter`
40
41 The container will expire after this time period.
42 The anchor is the reference point for the expiration.
43 The minutes is the number of minutes after the anchor before the container expires.
44
45 - `Optional<Anchor> anchor`
46
47 The reference point for the expiration.
48
49 - `LAST_ACTIVE_AT("last_active_at")`
50
51 - `Optional<Long> minutes`
52
53 The number of minutes after the anchor before the container expires.
54
55 - `Optional<Long> lastActiveAt`
56
57 Unix timestamp (in seconds) when the container was last active.
58
59 - `Optional<MemoryLimit> memoryLimit`
60
61 The memory limit configured for the container.
62
63 - `_1G("1g")`
64
65 - `_4G("4g")`
66
67 - `_16G("16g")`
68
69 - `_64G("64g")`
70
71 - `Optional<NetworkPolicy> networkPolicy`
72
73 Network access policy for the container.
74
75 - `Type type`
76
77 The network policy mode.
78
79 - `ALLOWLIST("allowlist")`
80
81 - `DISABLED("disabled")`
82
83 - `Optional<List<String>> allowedDomains`
84
85 Allowed outbound domains when `type` is `allowlist`.
86
87### Example
88
89```java
90package com.openai.example;
91
92import com.openai.client.OpenAIClient;
93import com.openai.client.okhttp.OpenAIOkHttpClient;
94import com.openai.models.containers.ContainerRetrieveParams;
95import com.openai.models.containers.ContainerRetrieveResponse;
96
97public final class Main {
98 private Main() {}
99
100 public static void main(String[] args) {
101 OpenAIClient client = OpenAIOkHttpClient.fromEnv();
102
103 ContainerRetrieveResponse container = client.containers().retrieve("container_id");
104 }
105}
106```
107
108#### Response
109
110```json
111{
112 "id": "id",
113 "created_at": 0,
114 "name": "name",
115 "object": "object",
116 "status": "status",
117 "expires_after": {
118 "anchor": "last_active_at",
119 "minutes": 0
120 },
121 "last_active_at": 0,
122 "memory_limit": "1g",
123 "network_policy": {
124 "type": "allowlist",
125 "allowed_domains": [
126 "string"
127 ]
128 }
129}
130```