|
1 | 1 |
|
2 | 2 |
|
3 | 3 |
|
4 | | -These samples show how to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types. |
| 4 | += These samples show how to submit jobs with `embedded`, `aws-s3`, `aws-s3-folder`, and `jdbc` input types. |
5 | 5 |
|
6 | 6 |
|
7 | 7 | This sample submits a job with an embedded image: |
8 | 8 |
|
9 | 9 | [source, js] |
10 | 10 | ---- |
11 | | -{ |
12 | | - "provide-any-name": {"model-input-name": "data:image/jpeg;base64,/.../2Q=="} |
13 | | -} |
| 11 | +let job = await modzyClient.submitJobEmbedded( |
| 12 | + "ed542963de", |
| 13 | + "0.0.27", |
| 14 | + "application/octet-stream", |
| 15 | + { |
| 16 | + "provide-any-name": {"model-input-name": "data:image/jpeg;base64,/.../2Q=="} |
| 17 | + } |
| 18 | + ); |
14 | 19 | ---- |
15 | 20 |
|
16 | 21 | This sample submits a job with a text file hosted in a `aws-s3` bucket: |
17 | 22 |
|
18 | 23 | [source, js] |
19 | 24 | ---- |
20 | | -{ |
21 | | -"ed542963de", |
22 | | -"0.0.27", |
23 | | -"accessKeyID": "key", |
24 | | - "secretAccessKey": "secret-key", |
25 | | - "region": "us-east-1", |
26 | | - "sources": |
27 | | - { |
28 | | - "provide-any-name": { |
29 | | - "model-input-name": { |
30 | | - "bucket": "bucket-name", |
31 | | - "key": "input_folder/happy.txt" |
32 | | - } |
33 | | - } |
34 | | - } |
35 | | -} |
| 25 | +let job = await modzyClient.submitJobAWSS3( |
| 26 | + "ed542963de", |
| 27 | + "0.0.27", |
| 28 | + "accessKeyID", |
| 29 | + "secretAccessKey", |
| 30 | + "us-east-1", |
| 31 | + { |
| 32 | + "provide-any-name": { |
| 33 | + "model-input-name": { |
| 34 | + "bucket": "bucket-name", |
| 35 | + "key": "input_folder/happy.txt" |
| 36 | + } |
| 37 | + } |
| 38 | + } |
| 39 | + ); |
36 | 40 | ---- |
37 | 41 |
|
38 | 42 | This sample submits a job with a all the files located in a `aws-s3` bucket directory: |
39 | 43 |
|
40 | 44 | [source, js] |
41 | 45 | ---- |
42 | | -{ |
43 | | -"ed542963de", |
44 | | -"0.0.27", |
45 | | -"accessKeyID": "key", |
46 | | - "secretAccessKey": "secret-key", |
47 | | - "region": "us-east-1", |
48 | | - "sources": { |
49 | | - "provide-any-name": { |
50 | | - "model-input-name": { |
51 | | - "bucket": "bucket-name", |
52 | | - "key": "image_input_folder" |
53 | | -
|
54 | | - } |
55 | | - } |
56 | | - } |
57 | | -} |
| 46 | +//update |
| 47 | +let job = await modzyClient.submitJobAWSS3( |
| 48 | + "ed542963de", |
| 49 | + "0.0.27", |
| 50 | + "accessKeyID", |
| 51 | + "secretAccessKey", |
| 52 | + "us-east-1", |
| 53 | + { |
| 54 | + "provide-any-name": { |
| 55 | + "model-input-name": { |
| 56 | + "bucket": "bucket-name", |
| 57 | + "key": "image_input_folder" |
| 58 | + } |
| 59 | + } |
| 60 | + } |
| 61 | + ); |
58 | 62 | ---- |
59 | 63 |
|
60 | 64 | This sample submits a job with data located in a `jdbc` database: |
61 | 65 |
|
62 | 66 | [source, js] |
63 | 67 | ---- |
64 | | -{ |
65 | | -{ |
66 | | - "provide-any-name": { |
67 | | - "type": "jdbc", |
68 | | - "url": "jdbc:sql://database-server.runajob.com:5432/db", |
69 | | - "username": "user", |
70 | | - "password": "password", |
71 | | - "driver": "org.postgresql.Driver", |
72 | | - "query":"select description as \"model-input-name\" from models.model" |
73 | | - } |
| 68 | +//update |
| 69 | +let job = await modzyClient.submitJobAWSS3( |
| 70 | + "ed542963de", |
| 71 | + "0.0.27", |
| 72 | + { |
| 73 | + "type": "jdbc", |
| 74 | + "url": "jdbc:sql://database-server.runajob.com:5432/db", |
| 75 | + "username": "user", |
| 76 | + "password": "password", |
| 77 | + "driver": "org.postgresql.Driver", |
| 78 | + "query":"select description as \"model-input-name\" from models.model" |
| 79 | + } |
| 80 | + ); |
74 | 81 | ---- |
0 commit comments