File: fixtures.go

package info (click to toggle)
golang-github-gophercloud-gophercloud 0.0~git20180917.45f1c769-1
  • links: PTS, VCS
  • area: main
  • in suites: buster
  • size: 7,768 kB
  • sloc: sh: 98; makefile: 14
file content (112 lines) | stat: -rw-r--r-- 3,806 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
package testing

import (
	"github.com/gophercloud/gophercloud/openstack/networking/v2/extensions/rbacpolicies"
)

const ListResponse = `
{
	"rbac_policies": [
		{
			"target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
			"tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
			"object_type": "network",
			"object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
			"action": "access_as_shared",
			"project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
			"id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
		},
		{
			"target_tenant": "1a547a3bcfe44702889fdeff3c3520c3",
			"tenant_id": "1ae27ce0a2a54cc6ae06dc62dd0ec832",
			"object_type": "network",
			"object_id": "120d22bf-bd17-4238-9758-25f72610ecdc",
			"action": "access_as_shared",
			"project_id": "1ae27ce0a2a54cc6ae06dc62dd0ec832",
			"id":"1ab7523a-93b5-4e69-9360-6c6bf986bb7c"
		}
	]
}`

// CreateRequest is the structure of request body to create rbac-policy.
const CreateRequest = `
{
    "rbac_policy": {
        "action": "access_as_shared",
        "object_type": "network",
        "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
        "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc"
    }
}`

// CreateResponse is the structure of response body of rbac-policy create.
const CreateResponse = `
{
    "rbac_policy": {
        "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
        "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
        "object_type": "network",
        "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
        "action": "access_as_shared",
        "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
        "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    }
}`

// GetResponse is the structure of the response body of rbac-policy get operation.
const GetResponse = `
{
    "rbac_policy": {
                        "target_tenant": "6e547a3bcfe44702889fdeff3c3520c3",
                        "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
                        "object_type": "network",
                        "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
                        "action": "access_as_shared",
                        "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
                        "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
        }
}`

// UpdateRequest is the structure of request body to update rbac-policy.
const UpdateRequest = `
{
    "rbac_policy": {
        "target_tenant": "9d766060b6354c9e8e2da44cab0e8f38"
    }
}`

// UpdateResponse is the structure of response body of rbac-policy update.
const UpdateResponse = `
{
    "rbac_policy": {
        "target_tenant": "9d766060b6354c9e8e2da44cab0e8f38",
        "tenant_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
        "object_type": "network",
        "object_id": "240d22bf-bd17-4238-9758-25f72610ecdc",
        "action": "access_as_shared",
        "project_id": "3de27ce0a2a54cc6ae06dc62dd0ec832",
        "id": "2cf7523a-93b5-4e69-9360-6c6bf986bb7c"
    }
}`

var rbacPolicy1 = rbacpolicies.RBACPolicy{
	ID:           "2cf7523a-93b5-4e69-9360-6c6bf986bb7c",
	Action:       rbacpolicies.ActionAccessShared,
	ObjectID:     "240d22bf-bd17-4238-9758-25f72610ecdc",
	ObjectType:   "network",
	TenantID:     "3de27ce0a2a54cc6ae06dc62dd0ec832",
	TargetTenant: "6e547a3bcfe44702889fdeff3c3520c3",
	ProjectID:    "3de27ce0a2a54cc6ae06dc62dd0ec832",
}

var rbacPolicy2 = rbacpolicies.RBACPolicy{
	ID:           "1ab7523a-93b5-4e69-9360-6c6bf986bb7c",
	Action:       rbacpolicies.ActionAccessShared,
	ObjectID:     "120d22bf-bd17-4238-9758-25f72610ecdc",
	ObjectType:   "network",
	TenantID:     "1ae27ce0a2a54cc6ae06dc62dd0ec832",
	TargetTenant: "1a547a3bcfe44702889fdeff3c3520c3",
	ProjectID:    "1ae27ce0a2a54cc6ae06dc62dd0ec832",
}

var ExpectedRBACPoliciesSlice = []rbacpolicies.RBACPolicy{rbacPolicy1, rbacPolicy2}