-
Notifications
You must be signed in to change notification settings - Fork 1
/
data_api_key.go
63 lines (60 loc) · 1.72 KB
/
data_api_key.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
package main
import (
"github.com/hashicorp/terraform/helper/schema"
)
// Data source for getting data for an existing API key
func dataSourceAPIKey() *schema.Resource {
return &schema.Resource{
Read: dataSourceAPIKeyRead,
Schema: map[string]*schema.Schema{
// INPUT REQUIRED
"id": {
Type: schema.TypeString,
Required: true,
Description: "The key to retrieve data for.",
},
// OUTPUT
"key": {
Type: schema.TypeString,
Computed: true,
Description: "The actual API key.",
},
"indexes": &schema.Schema{
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Computed: true,
Description: "List of target indexes. Supports the wildcard syntax.",
},
"acl": &schema.Schema{
Type: schema.TypeList,
Elem: &schema.Schema{
Type: schema.TypeString,
},
Computed: true,
Description: "List of permissions associated with this key.",
},
"description": &schema.Schema{
Type: schema.TypeString,
Computed: true,
Description: "Description of this key. Informative only.",
},
"validity": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
Description: "A Unix timestamp used to define the expiration date of this key.",
},
"max_queries_per_ip_per_hour": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
Description: "Specify the maximum number of API calls allowed from an IP address per hour. 0 = unlimited.",
},
"max_hits_per_query": &schema.Schema{
Type: schema.TypeInt,
Computed: true,
Description: "Specify the maximum number of hits this key can retrieve in one call. 0 = unlimited.",
},
},
}
}