File: fixtures.go

package info (click to toggle)
golang-github-gophercloud-utils 0.0~git20231010.80377ec-2
  • links: PTS, VCS
  • area: main
  • in suites: forky, sid, trixie
  • size: 816 kB
  • sloc: sh: 20; makefile: 7
file content (215 lines) | stat: -rw-r--r-- 4,830 bytes parent folder | download | duplicates (3)
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
package testing

import "github.com/gophercloud/utils/gnocchi/metric/v1/archivepolicies"

// ArchivePoliciesListResult represents a raw server response from a server to a list call.
const ArchivePoliciesListResult = `
[
    {
        "aggregation_methods": [
            "max",
            "min"
        ],
        "back_window": 0,
        "definition": [
            {
                "granularity": "1:00:00",
                "points": 2304,
                "timespan": "96 days, 0:00:00"
            },
            {
                "granularity": "0:05:00",
                "points": 9216,
                "timespan": "32 days, 0:00:00"
            },
            {
                "granularity": "1 day, 0:00:00",
                "points": 400,
                "timespan": "400 days, 0:00:00"
            }
        ],
        "name": "precise"
    },
    {
        "aggregation_methods": [
            "mean",
            "sum"
        ],
        "back_window": 12,
        "definition": [
            {
                "granularity": "1:00:00",
                "points": 2160,
                "timespan": "90 days, 0:00:00"
            },
            {
                "granularity": "1 day, 0:00:00",
                "points": 200,
                "timespan": "200 days, 0:00:00"
            }
        ],
        "name": "not_so_precise"
    }
]
`

// ListArchivePoliciesExpected represents an expected repsonse from a List request.
var ListArchivePoliciesExpected = []archivepolicies.ArchivePolicy{
	{
		AggregationMethods: []string{
			"max",
			"min",
		},
		BackWindow: 0,
		Definition: []archivepolicies.ArchivePolicyDefinition{
			{
				Granularity: "1:00:00",
				Points:      2304,
				TimeSpan:    "96 days, 0:00:00",
			},
			{
				Granularity: "0:05:00",
				Points:      9216,
				TimeSpan:    "32 days, 0:00:00",
			},
			{
				Granularity: "1 day, 0:00:00",
				Points:      400,
				TimeSpan:    "400 days, 0:00:00",
			},
		},
		Name: "precise",
	},
	{
		AggregationMethods: []string{
			"mean",
			"sum",
		},
		BackWindow: 12,
		Definition: []archivepolicies.ArchivePolicyDefinition{
			{
				Granularity: "1:00:00",
				Points:      2160,
				TimeSpan:    "90 days, 0:00:00",
			},
			{
				Granularity: "1 day, 0:00:00",
				Points:      200,
				TimeSpan:    "200 days, 0:00:00",
			},
		},
		Name: "not_so_precise",
	},
}

// ArchivePolicyGetResult represents a raw server response from a server to a get request.
const ArchivePolicyGetResult = `
{
    "aggregation_methods": [
        "max",
        "min",
        "mean"
    ],
    "back_window": 128,
    "definition": [
        {
            "granularity": "1:00:00",
            "points": 2160,
            "timespan": "90 days, 0:00:00"
        },
        {
            "granularity": "1 day, 0:00:00",
            "points": 100,
            "timespan": "100 days, 0:00:00"
        }
    ],
    "name": "test_policy"
}
`

// ArchivePolicyCreateRequest represents a raw create request.
const ArchivePolicyCreateRequest = `
{
    "aggregation_methods": [
        "sum",
        "mean",
        "count"
    ],
    "back_window": 31,
    "definition": [
        {
            "granularity": "1:00:00",
            "timespan": "90 days, 0:00:00"
        },
        {
            "granularity": "1 day, 0:00:00",
            "timespan": "100 days, 0:00:00"
        }
    ],
    "name": "test_policy"
}
`

// ArchivePolicyCreateResponse represents a raw server response from a server to a create request.
const ArchivePolicyCreateResponse = `
{
    "aggregation_methods": [
        "sum",
        "mean",
        "count"
    ],
    "back_window": 31,
    "definition": [
        {
            "granularity": "1:00:00",
            "points": 2160,
            "timespan": "90 days, 0:00:00"
        },
        {
            "granularity": "1 day, 0:00:00",
            "points": 100,
            "timespan": "100 days, 0:00:00"
        }
    ],
    "name": "test_policy"
}
`

// ArchivePolicyUpdateRequest represents a raw update request.
const ArchivePolicyUpdateRequest = `
{
    "definition": [
        {
            "timespan": "30 days, 0:00:00",
            "granularity": "12:00:00"
        },
        {
            "timespan": "90 days, 0:00:00",
            "granularity": "1 day, 0:00:00"
        }
    ]
}
`

// ArchivePolicyUpdateResponse represents a raw server response from a server to an update request.
const ArchivePolicyUpdateResponse = `
{
    "definition": [
        {
            "points": 60,
            "timespan": "30 days, 0:00:00",
            "granularity": "12:00:00"
        },
        {
            "points": 90,
            "timespan": "90 days, 0:00:00",
            "granularity": "1 day, 0:00:00"
        }
    ],
    "back_window": 0,
    "name": "test_policy",
    "aggregation_methods": [
        "max"
    ]
}
`