@@ -77,16 +77,25 @@ module YetiSetup
77
77
"\" name\" :\" #{ name } \" , " +
78
78
"\" user_guids\" : [\" #{ user_guid } \" ], " +
79
79
"\" manager_guids\" : [\" #{ user_guid } \" ], " +
80
- "\" billing_enabled\" : true, " +
81
80
"\" quota_definition_guid\" : \" #{ quota_guid } \" " +
82
81
"}'" +
83
82
" #{ cc_url } /v2/organizations"
84
83
output = run cmd
85
84
guid = output [ /"guid": "([^"]*)/ , 1 ]
86
- error "could not extract space guid" unless guid
85
+ error "could not extract org guid" unless guid
86
+
87
+ enable_billing ( cc_url , token , guid )
87
88
guid
88
89
end
89
90
91
+ def self . enable_billing ( cc_url , token , guid )
92
+ puts "# setting billing_enabled: true"
93
+ cmd = "curl -v -X PUT -H 'Content-Type: application/json' " +
94
+ " -H 'Authorization: #{ token } ' " +
95
+ " -d '{\" billing_enabled\" :true}'" +
96
+ " #{ cc_url } /v2/organizations/#{ guid } "
97
+ run cmd
98
+ end
90
99
91
100
def self . create_cc_space ( cc_url , token , name , org_guid , user_guid )
92
101
puts "# creating cc space"
@@ -101,7 +110,7 @@ module YetiSetup
101
110
" #{ cc_url } /v2/spaces"
102
111
output = run cmd
103
112
guid = output [ /"guid": "([^"]*)/ , 1 ]
104
- error "could not extract org guid" unless guid
113
+ error "could not extract space guid" unless guid
105
114
guid
106
115
end
107
116
0 commit comments