@@ -31,16 +31,16 @@ Create an instance of the Zencoder client. This will accept an API key and versi
31
31
Create a [ new job] ( https://app.zencoder.com/docs/api/jobs/create ) .
32
32
33
33
``` python
34
- zen .job.create(' s3://bucket/key.mp4' )
35
- zen .job.create(' s3://bucket/key.mp4' ,
34
+ client .job.create(' s3://bucket/key.mp4' )
35
+ client .job.create(' s3://bucket/key.mp4' ,
36
36
outputs = [{' label' : ' vp8 for the web' ,
37
37
' url' : ' s3://bucket/key_output.webm' }])
38
38
```
39
39
40
40
This returns a ` zencoder.Response ` object. The body includes a Job ID, and one or more Output IDs (one for every output file created).
41
41
42
42
``` python
43
- response = zen .job.create(' s3://bucket/key.mp4' )
43
+ response = client .job.create(' s3://bucket/key.mp4' )
44
44
response.code # 201
45
45
response.body[' id' ] # 12345
46
46
```
@@ -50,39 +50,40 @@ response.body['id'] # 12345
50
50
By default the jobs listing is paginated with 50 jobs per page and sorted by ID in descending order. You can pass two parameters to control the paging: ` page ` and ` per_page ` .
51
51
52
52
``` python
53
- zen .job.list(per_page = 10 )
54
- zen .job.list(per_page = 10 , page = 2 )
53
+ client .job.list(per_page = 10 )
54
+ client .job.list(per_page = 10 , page = 2 )
55
55
```
56
56
57
57
Get [ details] ( https://app.zencoder.com/docs/api/jobs/show ) about a job.
58
58
59
59
The number passed to ` details ` is the ID of a Zencoder job.
60
60
61
61
``` python
62
- zen .job.details(1 )
62
+ client .job.details(1 )
63
63
```
64
64
65
65
Get [ progress] ( https://app.zencoder.com/docs/api/jobs/progress ) on a job.
66
66
67
67
The number passed to ` progress ` is the ID of a Zencoder job.
68
68
69
69
``` python
70
- zen .job.progress(1 )
70
+ client .job.progress(1 )
71
71
```
72
72
73
73
[ Resubmit] ( https://app.zencoder.com/docs/api/jobs/resubmit ) a job
74
74
75
75
The number passed to ` resubmit ` is the ID of a Zencoder job.
76
76
77
77
``` python
78
- zen .job.resubmit(1 )
78
+ client .job.resubmit(1 )
79
79
```
80
80
81
81
[ Cancel] ( https://app.zencoder.com/docs/api/jobs/cancel ) a job
82
82
83
83
The number passed to ` cancel ` is the ID of a Zencoder job.
84
84
85
85
``` python
86
+ client.job.cancel(1 )
86
87
```
87
88
88
89
## [ Inputs] ( https://app.zencoder.com/docs/api/inputs )
@@ -92,15 +93,15 @@ Get [details](https://app.zencoder.com/docs/api/inputs/show) about an input.
92
93
The number passed to ` details ` is the ID of a Zencoder job.
93
94
94
95
``` python
95
- zen .input.details(1 )
96
+ client .input.details(1 )
96
97
```
97
98
98
99
Get [ progress] ( https://app.zencoder.com/docs/api/inputs/progress ) for an input.
99
100
100
101
The number passed to ` progress ` is the ID of a Zencoder job.
101
102
102
103
``` python
103
- zen .input.progress(1 )
104
+ client .input.progress(1 )
104
105
```
105
106
106
107
## [ Outputs] ( https://app.zencoder.com/docs/api/outputs )
@@ -110,15 +111,15 @@ Get [details](https://app.zencoder.com/docs/api/outputs/show) about an output.
110
111
The number passed to ` details ` is the ID of a Zencoder job.
111
112
112
113
``` python
113
- zen .output.details(1 )
114
+ client .output.details(1 )
114
115
```
115
116
116
117
Get [ progress] ( https://app.zencoder.com/docs/api/outputs/progress ) for an output.
117
118
118
119
The number passed to ` progress ` is the ID of a Zencoder job.
119
120
120
121
``` python
121
- zen .output.progress(1 )
122
+ client .output.progress(1 )
122
123
```
123
124
124
125
## [ Reports] ( https://app.zencoder.com/docs/api/reports )
@@ -129,11 +130,11 @@ Get [all usage](https://app.zencoder.com/docs/api/reports/all) (Live + VOD).
129
130
130
131
``` python
131
132
import datetime
132
- zen .report.all()
133
- zen .report.all(grouping = " foo" )
134
- zen .report.all(start_date = datetime.date(2011 , 10 , 30 ),
133
+ client .report.all()
134
+ client .report.all(grouping = " foo" )
135
+ client .report.all(start_date = datetime.date(2011 , 10 , 30 ),
135
136
end_date = datetime.date(2011 , 11 , 24 ))
136
- zen .report.all(start_date = datetime.date(2011 , 10 , 30 ),
137
+ client .report.all(start_date = datetime.date(2011 , 10 , 30 ),
137
138
end_date = datetime.date(2011 , 11 , 24 ),
138
139
grouping = " foo" )
139
140
```
@@ -142,11 +143,11 @@ Get [VOD usage](https://app.zencoder.com/docs/api/reports/vod).
142
143
143
144
``` python
144
145
import datetime
145
- zen .report.vod()
146
- zen .report.vod(grouping = " foo" )
147
- zen .report.vod(start_date = datetime.date(2011 , 10 , 30 ),
146
+ client .report.vod()
147
+ client .report.vod(grouping = " foo" )
148
+ client .report.vod(start_date = datetime.date(2011 , 10 , 30 ),
148
149
end_date = datetime.date(2011 , 11 , 24 ))
149
- zen .report.vod(start_date = datetime.date(2011 , 10 , 30 ),
150
+ client .report.vod(start_date = datetime.date(2011 , 10 , 30 ),
150
151
end_date = datetime.date(2011 , 11 , 24 ),
151
152
grouping = " foo" )
152
153
```
@@ -155,11 +156,11 @@ Get [Live usage](https://app.zencoder.com/docs/api/reports/live).
155
156
156
157
``` python
157
158
import datetime
158
- zen .report.live()
159
- zen .report.live(grouping = " foo" )
160
- zen .report.live(start_date = datetime.date(2011 , 10 , 30 ),
159
+ client .report.live()
160
+ client .report.live(grouping = " foo" )
161
+ client .report.live(start_date = datetime.date(2011 , 10 , 30 ),
161
162
end_date = datetime.date(2011 , 11 , 24 ))
162
- zen .report.live(start_date = datetime.date(2011 , 10 , 30 ),
163
+ client .report.live(start_date = datetime.date(2011 , 10 , 30 ),
163
164
end_date = datetime.date(2011 , 11 , 24 ),
164
165
grouping = " foo" )
165
166
```
@@ -171,28 +172,28 @@ Create a [new account](https://app.zencoder.com/docs/api/accounts/create). A uni
171
172
No API Key is required.
172
173
173
174
``` python
174
- zen .account.create(' foo@example.com' , tos = 1 )
175
- zen .account.create(' foo@example.com' , tos = 1 ,
175
+ client .account.create(' foo@example.com' , tos = 1 )
176
+ client .account.create(' foo@example.com' , tos = 1 ,
176
177
options = {' password' : ' abcd1234' ,
177
178
' affiliate_code' : ' foo' })
178
179
```
179
180
180
181
Get [ details] ( https://app.zencoder.com/docs/api/accounts/show ) about the current account.
181
182
182
183
``` python
183
- zen .account.details()
184
+ client .account.details()
184
185
```
185
186
186
187
Turn [ integration mode] ( https://app.zencoder.com/docs/api/accounts/integration ) on (all jobs are test jobs).
187
188
188
189
``` python
189
- zen .account.integration()
190
+ client .account.integration()
190
191
```
191
192
192
193
Turn off integration mode, which means your account is live (and you'll be billed for jobs).
193
194
194
195
``` python
195
- zen .account.live()
196
+ client .account.live()
196
197
```
197
198
## Tests
198
199
0 commit comments