-
Notifications
You must be signed in to change notification settings - Fork 57
/
run_test.go
1325 lines (1137 loc) · 64.4 KB
/
run_test.go
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
752
753
754
755
756
757
758
759
760
761
762
763
764
765
766
767
768
769
770
771
772
773
774
775
776
777
778
779
780
781
782
783
784
785
786
787
788
789
790
791
792
793
794
795
796
797
798
799
800
801
802
803
804
805
806
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
package app_test
import (
"bufio"
"bytes"
"io"
"strings"
"testing"
"github.com/fastly/cli/pkg/api"
"github.com/fastly/cli/pkg/app"
"github.com/fastly/cli/pkg/config"
"github.com/fastly/cli/pkg/errors"
"github.com/fastly/cli/pkg/mock"
"github.com/fastly/cli/pkg/testutil"
"github.com/fastly/cli/pkg/update"
)
func TestApplication(t *testing.T) {
// These tests should only verify the app.Run helper wires things up
// correctly, and check behaviors that can't be associated with a specific
// command or subcommand. Commands should be tested in their packages,
// leveraging the app.Run helper as appropriate.
for _, testcase := range []struct {
name string
args []string
wantOut string
wantErr string
}{
{
name: "no args",
args: nil,
wantErr: helpDefault + "\nERROR: error parsing arguments: command not specified.\n",
},
{
name: "help flag only",
args: []string{"--help"},
wantErr: helpDefault + "\nERROR: error parsing arguments: command not specified.\n",
},
{
name: "help argument only",
args: []string{"help"},
wantErr: fullFatHelpDefault,
},
{
name: "help service",
args: []string{"help", "service"},
wantErr: helpService,
},
} {
t.Run(testcase.name, func(t *testing.T) {
var (
args = testcase.args
env = config.Environment{}
file = config.File{}
configFilePath = "/dev/null"
clientFactory = mock.APIClient(mock.API{})
httpClient api.HTTPClient = nil
versioner update.Versioner = nil
stdin io.Reader = nil
stdout bytes.Buffer
stderr bytes.Buffer
)
err := app.Run(args, env, file, configFilePath, clientFactory, httpClient, versioner, stdin, &stdout)
if err != nil {
errors.Deduce(err).Print(&stderr)
}
// Our flag package creates trailing space on
// some lines. Strip what we get so we don't
// need to maintain invisible spaces in
// wantOut/wantErr below.
testutil.AssertString(t, testcase.wantOut, stripTrailingSpace(stdout.String()))
testutil.AssertString(t, testcase.wantErr, stripTrailingSpace(stderr.String()))
})
}
}
// stripTrailingSpace removes any trailing spaces from the multiline str.
func stripTrailingSpace(str string) string {
buf := bytes.NewBuffer(nil)
scan := bufio.NewScanner(strings.NewReader(str))
for scan.Scan() {
buf.WriteString(strings.TrimRight(scan.Text(), " \t\r\n"))
buf.WriteString("\n")
}
return buf.String()
}
var helpDefault = strings.TrimSpace(`
USAGE
fastly [<flags>] <command> [<args> ...]
A tool to interact with the Fastly API
GLOBAL FLAGS
--help Show context-sensitive help.
-t, --token=TOKEN Fastly API token (or via FASTLY_API_TOKEN)
-v, --verbose Verbose logging
COMMANDS
help Show help.
configure Configure the Fastly CLI
whoami Get information about the currently authenticated account
version Display version information for the Fastly CLI
update Update the CLI to the latest version
service Manipulate Fastly services
service-version Manipulate Fastly service versions
compute Manage Compute@Edge packages
domain Manipulate Fastly service version domains
backend Manipulate Fastly service version backends
healthcheck Manipulate Fastly service version healthchecks
logging Manipulate Fastly service version logging endpoints
stats View statistics (historical and realtime) for a Fastly
service
`) + "\n\n"
var helpService = strings.TrimSpace(`
USAGE
fastly [<flags>] service
GLOBAL FLAGS
--help Show context-sensitive help.
-t, --token=TOKEN Fastly API token (or via FASTLY_API_TOKEN)
-v, --verbose Verbose logging
SUBCOMMANDS
service create --name=NAME [<flags>]
Create a Fastly service
-n, --name=NAME Service name
--type=wasm Service type. Can be one of "wasm" or "vcl", defaults
to "wasm".
--comment=COMMENT Human-readable comment
service list
List Fastly services
service describe [<flags>]
Show detailed information about a Fastly service
-s, --service-id=SERVICE-ID Service ID
service update [<flags>]
Update a Fastly service
-s, --service-id=SERVICE-ID Service ID
-n, --name=NAME Service name
--comment=COMMENT Human-readable comment
service delete [<flags>]
Delete a Fastly service
-s, --service-id=SERVICE-ID Service ID
`) + "\n\n"
var fullFatHelpDefault = strings.TrimSpace(`
USAGE
fastly [<flags>] <command>
A tool to interact with the Fastly API
GLOBAL FLAGS
--help Show context-sensitive help.
-t, --token=TOKEN Fastly API token (or via FASTLY_API_TOKEN)
-v, --verbose Verbose logging
COMMANDS
help [<command> ...]
Show help.
configure
Configure the Fastly CLI
whoami
Get information about the currently authenticated account
version
Display version information for the Fastly CLI
update
Update the CLI to the latest version
service create --name=NAME [<flags>]
Create a Fastly service
-n, --name=NAME Service name
--type=wasm Service type. Can be one of "wasm" or "vcl", defaults
to "wasm".
--comment=COMMENT Human-readable comment
service list
List Fastly services
service describe [<flags>]
Show detailed information about a Fastly service
-s, --service-id=SERVICE-ID Service ID
service update [<flags>]
Update a Fastly service
-s, --service-id=SERVICE-ID Service ID
-n, --name=NAME Service name
--comment=COMMENT Human-readable comment
service delete [<flags>]
Delete a Fastly service
-s, --service-id=SERVICE-ID Service ID
service-version clone --version=VERSION [<flags>]
Clone a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version you wish to clone
service-version list [<flags>]
List Fastly service versions
-s, --service-id=SERVICE-ID Service ID
service-version update --version=VERSION --comment=COMMENT [<flags>]
Update a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version you wish to update
--comment=COMMENT Human-readable comment
service-version activate --version=VERSION [<flags>]
Activate a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version you wish to activate
service-version deactivate --version=VERSION [<flags>]
Deactivate a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version you wish to deactivate
service-version lock --version=VERSION [<flags>]
Lock a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version you wish to lock
compute init [<flags>]
Initialize a new Compute@Edge package locally
-n, --name=NAME Name of package, defaulting to directory name
of the --path destination
-d, --description=DESCRIPTION Description of the package
-a, --author=AUTHOR Author of the package
-f, --from=FROM Git repository containing package template
-p, --path=PATH Destination to write the new package,
defaulting to the current directory
--domain=DOMAIN The name of the domain associated to the
package
--backend=BACKEND A hostname, IPv4, or IPv6 address for the
package backend
compute build [<flags>]
Build a Compute@Edge package locally
--name=NAME Package name
--language=LANGUAGE Language type
--force Skip verification steps and force build
compute deploy [<flags>]
Deploy a package to a Fastly Compute@Edge service
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of version to activate
-p, --path=PATH Path to package
compute update --service-id=SERVICE-ID --version=VERSION --path=PATH
Update a package on a Fastly Compute@Edge service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-p, --path=PATH Path to package
compute validate --path=PATH
Validate a Compute@Edge package
-p, --path=PATH Path to package
domain create --name=NAME --version=VERSION [<flags>]
Create a domain on a Fastly service version
-n, --name=NAME Domain name
--comment=COMMENT A descriptive note
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
domain list --version=VERSION [<flags>]
List domains on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
domain describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a domain on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME Name of domain
domain update --version=VERSION --name=NAME [<flags>]
Update a domain on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Domain name
--new-name=NEW-NAME New domain name
--comment=COMMENT A descriptive note
domain delete --name=NAME --version=VERSION [<flags>]
Delete a domain on a Fastly service version
-n, --name=NAME Domain name
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
backend create --service-id=SERVICE-ID --version=VERSION --name=NAME --address=ADDRESS [<flags>]
Create a backend on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Backend name
--address=ADDRESS A hostname, IPv4, or IPv6 address for the
backend
--comment=COMMENT A descriptive note
--port=PORT Port number of the address
--override-host=OVERRIDE-HOST
The hostname to override the Host header
--connect-timeout=CONNECT-TIMEOUT
How long to wait for a timeout in
milliseconds
--max-conn=MAX-CONN Maximum number of connections
--first-byte-timeout=FIRST-BYTE-TIMEOUT
How long to wait for the first bytes in
milliseconds
--between-bytes-timeout=BETWEEN-BYTES-TIMEOUT
How long to wait between bytes in
milliseconds
--auto-loadbalance Whether or not this backend should be
automatically load balanced
--weight=WEIGHT Weight used to load balance this backend
against others
--request-condition=REQUEST-CONDITION
Condition, which if met, will select this
backend during a request
--healthcheck=HEALTHCHECK The name of the healthcheck to use with this
backend
--shield=SHIELD The shield POP designated to reduce inbound
load on this origin by serving the cached
data to the rest of the network
--use-ssl Whether or not to use SSL to reach the
backend
--ssl-check-cert Be strict on checking SSL certs
--ssl-ca-cert=SSL-CA-CERT CA certificate attached to origin
--ssl-client-cert=SSL-CLIENT-CERT
Client certificate attached to origin
--ssl-client-key=SSL-CLIENT-KEY
Client key attached to origin
--ssl-cert-hostname=SSL-CERT-HOSTNAME
Overrides ssl_hostname, but only for cert
verification. Does not affect SNI at all.
--ssl-sni-hostname=SSL-SNI-HOSTNAME
Overrides ssl_hostname, but only for SNI in
the handshake. Does not affect cert
validation at all.
--min-tls-version=MIN-TLS-VERSION
Minimum allowed TLS version on SSL
connections to this backend
--max-tls-version=MAX-TLS-VERSION
Maximum allowed TLS version on SSL
connections to this backend
--ssl-ciphers=SSL-CIPHERS ...
List of OpenSSL ciphers (see
https://www.openssl.org/docs/manmaster/man1/ciphers.html
for details)
backend list --service-id=SERVICE-ID --version=VERSION
List backends on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
backend describe --service-id=SERVICE-ID --version=VERSION --name=NAME
Show detailed information about a backend on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Name of backend
backend update --service-id=SERVICE-ID --version=VERSION --name=NAME [<flags>]
Update a backend on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME backend name
--new-name=NEW-NAME New backend name
--comment=COMMENT A descriptive note
--address=ADDRESS A hostname, IPv4, or IPv6 address for the
backend
--port=PORT Port number of the address
--override-host=OVERRIDE-HOST
The hostname to override the Host header
--connect-timeout=CONNECT-TIMEOUT
How long to wait for a timeout in
milliseconds
--max-conn=MAX-CONN Maximum number of connections
--first-byte-timeout=FIRST-BYTE-TIMEOUT
How long to wait for the first bytes in
milliseconds
--between-bytes-timeout=BETWEEN-BYTES-TIMEOUT
How long to wait between bytes in
milliseconds
--auto-loadbalance Whether or not this backend should be
automatically load balanced
--weight=WEIGHT Weight used to load balance this backend
against others
--request-condition=REQUEST-CONDITION
condition, which if met, will select this
backend during a request
--healthcheck=HEALTHCHECK The name of the healthcheck to use with this
backend
--shield=SHIELD The shield POP designated to reduce inbound
load on this origin by serving the cached
data to the rest of the network
--use-ssl Whether or not to use SSL to reach the
backend
--ssl-check-cert Be strict on checking SSL certs
--ssl-ca-cert=SSL-CA-CERT CA certificate attached to origin
--ssl-client-cert=SSL-CLIENT-CERT
Client certificate attached to origin
--ssl-client-key=SSL-CLIENT-KEY
Client key attached to origin
--ssl-cert-hostname=SSL-CERT-HOSTNAME
Overrides ssl_hostname, but only for cert
verification. Does not affect SNI at all.
--ssl-sni-hostname=SSL-SNI-HOSTNAME
Overrides ssl_hostname, but only for SNI in
the handshake. Does not affect cert
validation at all.
--min-tls-version=MIN-TLS-VERSION
Minimum allowed TLS version on SSL
connections to this backend
--max-tls-version=MAX-TLS-VERSION
Maximum allowed TLS version on SSL
connections to this backend
--ssl-ciphers=SSL-CIPHERS ...
List of OpenSSL ciphers (see
https://www.openssl.org/docs/manmaster/man1/ciphers.html
for details)
backend delete --service-id=SERVICE-ID --version=VERSION --name=NAME
Delete a backend on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Backend name
healthcheck create --version=VERSION --name=NAME [<flags>]
Create a healthcheck on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Healthcheck name
--comment=COMMENT A descriptive note
--method=METHOD Which HTTP method to use
--host=HOST Which host to check
--path=PATH The path to check
--http-version=HTTP-VERSION
Whether to use version 1.0 or 1.1 HTTP
--timeout=TIMEOUT Timeout in milliseconds
--check-interval=CHECK-INTERVAL
How often to run the healthcheck in
milliseconds
--expected-response=EXPECTED-RESPONSE
The status code expected from the host
--window=WINDOW The number of most recent healthcheck queries
to keep for this healthcheck
--threshold=THRESHOLD How many healthchecks must succeed to be
considered healthy
--initial=INITIAL When loading a config, the initial number of
probes to be seen as OK
healthcheck list --version=VERSION [<flags>]
List healthchecks on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
healthcheck describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a healthcheck on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Name of healthcheck
healthcheck update --version=VERSION --name=NAME [<flags>]
Update a healthcheck on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Healthcheck name
--new-name=NEW-NAME Healthcheck name
--comment=COMMENT A descriptive note
--method=METHOD Which HTTP method to use
--host=HOST Which host to check
--path=PATH The path to check
--http-version=HTTP-VERSION
Whether to use version 1.0 or 1.1 HTTP
--timeout=TIMEOUT Timeout in milliseconds
--check-interval=CHECK-INTERVAL
How often to run the healthcheck in
milliseconds
--expected-response=EXPECTED-RESPONSE
The status code expected from the host
--window=WINDOW The number of most recent healthcheck queries
to keep for this healthcheck
--threshold=THRESHOLD How many healthchecks must succeed to be
considered healthy
--initial=INITIAL When loading a config, the initial number of
probes to be seen as OK
healthcheck delete --version=VERSION --name=NAME [<flags>]
Delete a healthcheck on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME Healthcheck name
logging bigquery create --name=NAME --version=VERSION --project-id=PROJECT-ID --dataset=DATASET --table=TABLE --user=USER --secret-key=SECRET-KEY [<flags>]
Create a BigQuery logging endpoint on a Fastly service version
-n, --name=NAME The name of the BigQuery logging object. Used
as a primary key for API access
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
--project-id=PROJECT-ID Your Google Cloud Platform project ID
--dataset=DATASET Your BigQuery dataset
--table=TABLE Your BigQuery table
--user=USER Your Google Cloud Platform service account
email address. The client_email field in your
service account authentication JSON.
--secret-key=SECRET-KEY Your Google Cloud Platform account secret key.
The private_key field in your service account
authentication JSON.
--template-suffix=TEMPLATE-SUFFIX
BigQuery table name suffix template
--format=FORMAT Apache style log formatting. Must produce JSON
that matches the schema of your BigQuery table
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
logging bigquery list --version=VERSION [<flags>]
List BigQuery endpoints on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
logging bigquery describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a BigQuery logging endpoint on a Fastly
service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME The name of the BigQuery logging object
logging bigquery update --version=VERSION --name=NAME [<flags>]
Update a BigQuery logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the BigQuery logging object
--new-name=NEW-NAME New name of the BigQuery logging object
--project-id=PROJECT-ID Your Google Cloud Platform project ID
--dataset=DATASET Your BigQuery dataset
--table=TABLE Your BigQuery table
--user=USER Your Google Cloud Platform service account
email address. The client_email field in your
service account authentication JSON.
--secret-key=SECRET-KEY Your Google Cloud Platform account secret key.
The private_key field in your service account
authentication JSON.
--template-suffix=TEMPLATE-SUFFIX
BigQuery table name suffix template
--format=FORMAT Apache style log formatting. Must produce JSON
that matches the schema of your BigQuery table
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug. This field
is not required and has no default value
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
logging bigquery delete --version=VERSION --name=NAME [<flags>]
Delete a BigQuery logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the BigQuery logging object
logging s3 create --name=NAME --version=VERSION --bucket=BUCKET --access-key=ACCESS-KEY --secret-key=SECRET-KEY [<flags>]
Create an Amazon S3 logging endpoint on a Fastly service version
-n, --name=NAME The name of the S3 logging object. Used as a
primary key for API access
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
--bucket=BUCKET Your S3 bucket name
--access-key=ACCESS-KEY Your S3 account access key
--secret-key=SECRET-KEY Your S3 account secret key
--domain=DOMAIN The domain of the S3 endpoint
--path=PATH The path to upload logs to
--period=PERIOD How frequently log files are finalized so they
can be available for reading (in seconds,
default 3600)
--gzip-level=GZIP-LEVEL What level of GZIP encoding to have when
dumping logs (default 0, no compression)
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(default) or 1
--message-type=MESSAGE-TYPE
How the message should be formatted. One of:
classic (default), loggly, logplex or blank
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--timestamp-format=TIMESTAMP-FORMAT
strftime specified timestamp formatting
(default "%Y-%m-%dT%H:%M:%S.000")
--redundancy=REDUNDANCY The S3 redundancy level. Can be either standard
or reduced_redundancy
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug
--server-side-encryption=SERVER-SIDE-ENCRYPTION
Set to enable S3 Server Side Encryption. Can be
either AES256 or aws:kms
--server-side-encryption-kms-key-id=SERVER-SIDE-ENCRYPTION-KMS-KEY-ID
Server-side KMS Key ID. Must be set if
server-side-encryption is set to aws:kms
logging s3 list --version=VERSION [<flags>]
List S3 endpoints on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
logging s3 describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a S3 logging endpoint on a Fastly service
version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME The name of the S3 logging object
logging s3 update --version=VERSION --name=NAME [<flags>]
Update a S3 logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the S3 logging object
--new-name=NEW-NAME New name of the S3 logging object
--bucket=BUCKET Your S3 bucket name
--access-key=ACCESS-KEY Your S3 account access key
--secret-key=SECRET-KEY Your S3 account secret key
--domain=DOMAIN The domain of the S3 endpoint
--path=PATH The path to upload logs to
--period=PERIOD How frequently log files are finalized so they
can be available for reading (in seconds,
default 3600)
--gzip-level=GZIP-LEVEL What level of GZIP encoding to have when
dumping logs (default 0, no compression)
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(default) or 1
--message-type=MESSAGE-TYPE
How the message should be formatted. One of:
classic (default), loggly, logplex or blank
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--timestamp-format=TIMESTAMP-FORMAT
strftime specified timestamp formatting
(default "%Y-%m-%dT%H:%M:%S.000")
--redundancy=REDUNDANCY The S3 redundancy level. Can be either standard
or reduced_redundancy
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug
--server-side-encryption=SERVER-SIDE-ENCRYPTION
Set to enable S3 Server Side Encryption. Can be
either AES256 or aws:kms
--server-side-encryption-kms-key-id=SERVER-SIDE-ENCRYPTION-KMS-KEY-ID
Server-side KMS Key ID. Must be set if
server-side-encryption is set to aws:kms
logging s3 delete --version=VERSION --name=NAME [<flags>]
Delete a S3 logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the S3 logging object
logging syslog create --name=NAME --version=VERSION --address=ADDRESS [<flags>]
Create a Syslog logging endpoint on a Fastly service version
-n, --name=NAME The name of the Syslog logging object. Used
as a primary key for API access
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
--address=ADDRESS A hostname or IPv4 address
--port=PORT The port number
--use-tls Whether to use TLS for secure logging. Can be
either true or false
--tls-ca-cert=TLS-CA-CERT A secure certificate to authenticate the
server with. Must be in PEM format
--tls-hostname=TLS-HOSTNAME
Used during the TLS handshake to validate the
certificate
--tls-client-cert=TLS-CLIENT-CERT
The client certificate used to make
authenticated requests. Must be in PEM format
--tls-client-key=TLS-CLIENT-KEY
The client private key used to make
authenticated requests. Must be in PEM format
--auth-token=AUTH-TOKEN Whether to prepend each message with a
specific token
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(default) or 1
--message-type=MESSAGE-TYPE
How the message should be formatted. One of:
classic (default), loggly, logplex or blank
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any
format_version default. Can be none or
waf_debug
logging syslog list --version=VERSION [<flags>]
List Syslog endpoints on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
logging syslog describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a Syslog logging endpoint on a Fastly
service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME The name of the Syslog logging object
logging syslog update --version=VERSION --name=NAME [<flags>]
Update a Syslog logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the Syslog logging object
--new-name=NEW-NAME New name of the Syslog logging object
--address=ADDRESS A hostname or IPv4 address
--port=PORT The port number
--use-tls Whether to use TLS for secure logging. Can be
either true or false
--tls-ca-cert=TLS-CA-CERT A secure certificate to authenticate the
server with. Must be in PEM format
--tls-hostname=TLS-HOSTNAME
Used during the TLS handshake to validate the
certificate
--tls-client-cert=TLS-CLIENT-CERT
The client certificate used to make
authenticated requests. Must be in PEM format
--tls-client-key=TLS-CLIENT-KEY
The client private key used to make
authenticated requests. Must be in PEM format
--auth-token=AUTH-TOKEN Whether to prepend each message with a
specific token
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(default) or 1
--message-type=MESSAGE-TYPE
How the message should be formatted. One of:
classic (default), loggly, logplex or blank
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any
format_version default. Can be none or
waf_debug
logging syslog delete --version=VERSION --name=NAME [<flags>]
Delete a Syslog logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the Syslog logging object
logging logentries create --name=NAME --version=VERSION [<flags>]
Create a Logentries logging endpoint on a Fastly service version
-n, --name=NAME The name of the Logentries logging object. Used
as a primary key for API access
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
--port=PORT The port number
--use-tls Whether to use TLS for secure logging. Can be
either true or false
--auth-token=AUTH-TOKEN Use token based authentication
(https://logentries.com/doc/input-token/)
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug. This field
is not required and has no default value
logging logentries list --version=VERSION [<flags>]
List Logentries endpoints on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
logging logentries describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a Logentries logging endpoint on a Fastly
service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME The name of the Logentries logging object
logging logentries update --version=VERSION --name=NAME [<flags>]
Update a Logentries logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the Logentries logging object
--new-name=NEW-NAME New name of the Logentries logging object
--port=PORT The port number
--use-tls Whether to use TLS for secure logging. Can be
either true or false
--auth-token=AUTH-TOKEN Use token based authentication
(https://logentries.com/doc/input-token/)
--format=FORMAT Apache style log formatting
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug. This field
is not required and has no default value
logging logentries delete --version=VERSION --name=NAME [<flags>]
Delete a Logentries logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the Logentries logging object
logging papertrail create --name=NAME --version=VERSION --address=ADDRESS [<flags>]
Create a Papertrail logging endpoint on a Fastly service version
-n, --name=NAME The name of the Papertrail logging object. Used
as a primary key for API access
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
--address=ADDRESS A hostname or IPv4 address
--port=PORT The port number
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
--format=FORMAT Apache style log formatting
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug. This field
is not required and has no default value
logging papertrail list --version=VERSION [<flags>]
List Papertrail endpoints on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
logging papertrail describe --version=VERSION --name=NAME [<flags>]
Show detailed information about a Papertrail logging endpoint on a Fastly
service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-d, --name=NAME The name of the Papertrail logging object
logging papertrail update --version=VERSION --name=NAME [<flags>]
Update a Papertrail logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version
-n, --name=NAME The name of the Papertrail logging object
--new-name=NEW-NAME New name of the Papertrail logging object
--address=ADDRESS A hostname or IPv4 address
--port=PORT The port number
--format-version=FORMAT-VERSION
The version of the custom logging format used
for the configured endpoint. Can be either 2
(the default, version 2 log format) or 1 (the
version 1 log format). The logging call gets
placed by default in vcl_log if format_version
is set to 2 and in vcl_deliver if
format_version is set to 1
--format=FORMAT Apache style log formatting
--response-condition=RESPONSE-CONDITION
The name of an existing condition in the
configured endpoint, or leave blank to always
execute
--placement=PLACEMENT Where in the generated VCL the logging call
should be placed, overriding any format_version
default. Can be none or waf_debug. This field
is not required and has no default value
logging papertrail delete --version=VERSION --name=NAME [<flags>]
Delete a Papertrail logging endpoint on a Fastly service version
-s, --service-id=SERVICE-ID Service ID
--version=VERSION Number of service version