Skip to content

Commit 3f2b7a4

Browse files
Residential proxies ping (#70)
* Update docs with new config for residential proxy * Less specific for mobile proxy * Fix descriptions * docs: update code samples from OpenAPI --------- Co-authored-by: github-actions[bot] <github-actions[bot]@users.noreply.github.com>
1 parent c078564 commit 3f2b7a4

File tree

8 files changed

+175
-22
lines changed

8 files changed

+175
-22
lines changed

proxies/mobile.mdx

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -16,10 +16,7 @@ const kernel = new Kernel();
1616

1717
const proxy = await kernel.proxies.create({
1818
type: 'mobile',
19-
name: 'my-tmobile-proxy',
20-
config: {
21-
carrier: 'tmobile'
22-
}
19+
name: 'mobile-proxy'
2320
});
2421

2522
const browser = await kernel.browsers.create({
@@ -33,10 +30,7 @@ client = kernel.Kernel()
3330

3431
proxy = client.proxies.create(
3532
type='mobile',
36-
name='my-tmobile-proxy',
37-
config={
38-
'carrier': 'tmobile'
39-
}
33+
name='mobile-proxy'
4034
)
4135

4236
browser = client.browsers.create(

proxies/residential.mdx

Lines changed: 9 additions & 14 deletions
Original file line numberDiff line numberDiff line change
@@ -16,12 +16,10 @@ const kernel = new Kernel();
1616

1717
const proxy = await kernel.proxies.create({
1818
type: 'residential',
19-
name: 'my-california-residential',
19+
name: 'my-la-residential',
2020
config: {
2121
country: 'US',
22-
city: 'sanfrancisco',
23-
zip: '94102',
24-
os: 'windows'
22+
city: 'los_angeles'
2523
}
2624
});
2725

@@ -36,12 +34,10 @@ client = kernel.Kernel()
3634

3735
proxy = client.proxies.create(
3836
type='residential',
39-
name='my-california-residential',
37+
name='my-la-residential',
4038
config={
4139
'country': 'US',
42-
'city': 'sanfrancisco',
43-
'zip': '94102',
44-
'os': 'windows'
40+
'city': 'los_angeles'
4541
}
4642
)
4743

@@ -54,9 +50,8 @@ browser = client.browsers.create(
5450

5551
## Configuration Parameters
5652

57-
- **`country`** - ISO 3166 country code
58-
- **`state`** - Two-letter state code. Only supported for US and Australia. Cannot be used with `city`
59-
- **`city`** - City name (lowercase, no spaces, e.g., `sanfrancisco`, `newyork`). Required if `zip` is provided
60-
- **`zip`** - US ZIP code (5 digits). Requires `city` to be provided
61-
- **`os`** - Operating system: `windows`, `macos`, or `android`
62-
- **`asn`** - Autonomous System Number. Mutually exclusive with geo-location targeting
53+
- **`country`** - ISO 3166 country code. Must be provided when providing other targeting options.
54+
- **`state`** - Two-letter state code. Only supported for US.
55+
- **`city`** - City name (lowercase, no spaces, e.g., `sanfrancisco`, `newyork`).
56+
- **`zip`** - US ZIP code (5 digits). Conflicts with city and state.
57+
- **`asn`** - Autonomous System Number. Conflicts with city and state.
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.extensions.delete('id_or_name');
10+
```
11+
12+
13+
```python Python
14+
from kernel import Kernel
15+
16+
client = Kernel(
17+
api_key="My API Key",
18+
)
19+
client.extensions.delete(
20+
"id_or_name",
21+
)
22+
```
23+
</CodeGroup>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 response = await client.extensions.downloadFromChromeStore({ url: 'url' });
10+
11+
console.log(response);
12+
13+
const content = await response.blob();
14+
console.log(content);
15+
```
16+
17+
18+
```python Python
19+
from kernel import Kernel
20+
21+
client = Kernel(
22+
api_key="My API Key",
23+
)
24+
response = client.extensions.download_from_chrome_store(
25+
url="url",
26+
)
27+
print(response)
28+
content = response.read()
29+
print(content)
30+
```
31+
</CodeGroup>
Lines changed: 31 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,31 @@
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 response = await client.extensions.download('id_or_name');
10+
11+
console.log(response);
12+
13+
const content = await response.blob();
14+
console.log(content);
15+
```
16+
17+
18+
```python Python
19+
from kernel import Kernel
20+
21+
client = Kernel(
22+
api_key="My API Key",
23+
)
24+
response = client.extensions.download(
25+
"id_or_name",
26+
)
27+
print(response)
28+
content = response.read()
29+
print(content)
30+
```
31+
</CodeGroup>
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 extensions = await client.extensions.list();
10+
11+
console.log(extensions);
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
extensions = client.extensions.list()
22+
print(extensions)
23+
```
24+
</CodeGroup>
Lines changed: 29 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,29 @@
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.browsers.uploadExtensions('id', {
10+
extensions: [{ name: 'name', zip_file: fs.createReadStream('path/to/file') }],
11+
});
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
client.browsers.upload_extensions(
22+
id="id",
23+
extensions=[{
24+
"name": "name",
25+
"zip_file": b"raw file contents",
26+
}],
27+
)
28+
```
29+
</CodeGroup>
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 response = await client.extensions.upload({ file: fs.createReadStream('path/to/file') });
10+
11+
console.log(response.id);
12+
```
13+
14+
15+
```python Python
16+
from kernel import Kernel
17+
18+
client = Kernel(
19+
api_key="My API Key",
20+
)
21+
response = client.extensions.upload(
22+
file=b"raw file contents",
23+
)
24+
print(response.id)
25+
```
26+
</CodeGroup>

0 commit comments

Comments
 (0)