Skip to content

Commit 9949471

Browse files
docs: update code samples from OpenAPI
1 parent 7ba74bb commit 9949471

7 files changed

Lines changed: 102 additions & 3 deletions

File tree

snippets/openapi/delete-browsers-id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ client = Kernel(
1717
api_key="My API Key",
1818
)
1919
client.browsers.delete_by_id(
20-
"id",
20+
"htzv5orfit78e1m2biiifpbv",
2121
)
2222
```
2323
</CodeGroup>
Lines changed: 23 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,23 @@
1+
<CodeGroup>
2+
```typescript Typescript/Javascript
3+
import Kernel from '@onkernel/sdk';
4+
5+
const client = new Kernel({
6+
apiKey: 'My API Key',
7+
});
8+
9+
await client.proxies.delete('id');
10+
```
11+
12+
13+
```python Python
14+
from kernel import Kernel
15+
16+
client = Kernel(
17+
api_key="My API Key",
18+
)
19+
client.proxies.delete(
20+
"id",
21+
)
22+
```
23+
</CodeGroup>

snippets/openapi/get-browsers-id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ client = Kernel(
1919
api_key="My API Key",
2020
)
2121
browser = client.browsers.retrieve(
22-
"id",
22+
"htzv5orfit78e1m2biiifpbv",
2323
)
2424
print(browser.session_id)
2525
```

snippets/openapi/get-invocations-id.mdx

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@ client = Kernel(
1919
api_key="My API Key",
2020
)
2121
invocation = client.invocations.retrieve(
22-
"id",
22+
"rr33xuugxj9h0bkf1rdt2bet",
2323
)
2424
print(invocation.id)
2525
```
Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<CodeGroup>
2+
```typescript Typescript/Javascript
3+
import Kernel from '@onkernel/sdk';
4+
5+
const client = new Kernel({
6+
apiKey: 'My API Key',
7+
});
8+
9+
const proxy = await client.proxies.retrieve('id');
10+
11+
console.log(proxy.id);
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
proxy = client.proxies.retrieve(
22+
"id",
23+
)
24+
print(proxy.id)
25+
```
26+
</CodeGroup>

snippets/openapi/get-proxies.mdx

Lines changed: 24 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,24 @@
1+
<CodeGroup>
2+
```typescript Typescript/Javascript
3+
import Kernel from '@onkernel/sdk';
4+
5+
const client = new Kernel({
6+
apiKey: 'My API Key',
7+
});
8+
9+
const proxies = await client.proxies.list();
10+
11+
console.log(proxies);
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
proxies = client.proxies.list()
22+
print(proxies)
23+
```
24+
</CodeGroup>

snippets/openapi/post-proxies.mdx

Lines changed: 26 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,26 @@
1+
<CodeGroup>
2+
```typescript Typescript/Javascript
3+
import Kernel from '@onkernel/sdk';
4+
5+
const client = new Kernel({
6+
apiKey: 'My API Key',
7+
});
8+
9+
const proxy = await client.proxies.create({ type: 'datacenter' });
10+
11+
console.log(proxy.id);
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
proxy = client.proxies.create(
22+
type="datacenter",
23+
)
24+
print(proxy.id)
25+
```
26+
</CodeGroup>

0 commit comments

Comments
 (0)