-
-
Notifications
You must be signed in to change notification settings - Fork 78
/
Copy pathcloud-foundry.http
137 lines (129 loc) · 4.38 KB
/
cloud-foundry.http
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
### Authenticate to the Cloud Foundry API
# @name access_token_request
POST {{$dotenv cf_login}}/oauth/token
Accept: application/json;charset=utf8
Authorization: Basic cf:
Content-Type: application/x-www-form-urlencoded
grant_type=password
&username={{$dotenv username}}
&password={{$dotenv password}}
# &login_hint={"origin":"sap.ids"}
# According to SAP Note https://launchpad.support.sap.com/#/notes/3140806
# currently only supported in Feature Set A
# According to the Roadmap Item "Customer ability to control users and their account access"
# https://roadmaps.sap.com/board?q=idp&range=CURRENT-LAST#;INNO=000D3AAADBCE1EDB9EEDE92DF8DF3E21
# the usage of IAS in Feature Set B should be possible beginning of July 2022
# Using Origin Key origin=sap.default results in:
# The origin provided in the login_hint does not match an active Identity Provider, that supports password grant.
# If you want to use your own IAS tenant, you have to uncomment the following line and maintain the variable origin in your .env file
#&login_hint={"origin":"{{$dotenv origin}}"}
### Save Access Token in local variable
@accToken = {{access_token_request.response.body.access_token}}
### List all Organizations
GET {{$dotenv cf_url}}/v3/organizations
Authorization: Bearer {{accToken}}
### Filter Organization by name
# @name getOrgByName
GET {{$dotenv cf_url}}/v3/organizations
?names={{$dotenv cf_org_name}}
Authorization: Bearer {{accToken}}
###
@orgId = {{getOrgByName.response.body.resources.0.guid}}
### Details of specific Organization
GET {{$dotenv cf_url}}/v3/organizations/{{orgId}}
Authorization: Bearer {{accToken}}
###
GET {{$dotenv cf_url}}/v3/spaces
Authorization: Bearer {{accToken}}
### Filter Space by name
# @name getSpaceByName
GET {{$dotenv cf_url}}/v3/spaces
?names=dev
&organization_guids={{orgId}}
Authorization: Bearer {{accToken}}
###
@spaceId = {{getSpaceByName.response.body.resources.0.guid}}
###
GET {{$dotenv cf_url}}/v3/spaces/{{spaceId}}
Authorization: Bearer {{accToken}}
### Read Service Instances in Space
# @name getServiceInstanceByName
GET {{$dotenv cf_url}}/v3/service_instances
?names={{$dotenv cf_service_name}}
&space_guids={{spaceId}}
Authorization: Bearer {{accToken}}
###
@serviceInstanceId = {{getServiceInstanceByName.response.body.resources.0.guid}}
### Create Service Key
# @name createServiceKey
POST {{$dotenv cf_url}}/v3/service_credential_bindings
Authorization: Bearer {{accToken}}
Content-Type: application/json
{
"name": "{{$dotenv cf_service_key_name}}",
"relationships": {
"service_instance": {
"data": {
"guid": "{{serviceInstanceId}}"
}
}
},
"type": "key"
}
###
@serviceKeyLocation = {{createServiceKey.response.headers.location}}
###
# @name getServiceKey
GET {{serviceKeyLocation}}
Authorization: Bearer {{accToken}}
###
@serviceCredentialBinding = {{getServiceKey.response.body.links.service_credential_binding.href}}
###
# @name getServiceKeyCredentials
GET {{serviceCredentialBinding}}
Authorization: Bearer {{accToken}}
###
# @name getAppByName
GET {{$dotenv cf_url}}/v3/apps
?organization_guids={{orgId}}
&space_guids={{spaceId}}
&names={{$dotenv cf_app_name}}
Authorization: Bearer {{accToken}}
###
@appId = {{getAppByName.response.body.resources.0.guid}}
### Create Task for App
# @name createTask
POST {{$dotenv cf_url}}/v3/apps/{{appId}}/tasks
Authorization: Bearer {{accToken}}
Content-Type: application/json
{
"command": "{{$dotenv cf_task_command}}",
"name": "{{$dotenv cf_task_name}}",
"memory_in_mb": 256
}
### Read Service Key by name
# @name getServiceKeyByName
GET {{$dotenv cf_url}}/v3/service_credential_bindings
?names={{$dotenv cf_service_key_name}}
&service_instance_guids={{serviceInstanceId}}
&type=key
Authorization: Bearer {{accToken}}
###
@serviceKeyId = {{getServiceKeyByName.response.body.resources.0.guid}}
### Delete Service Key
DELETE {{$dotenv cf_url}}/v3/service_credential_bindings/{{serviceKeyId}}
Authorization: Bearer {{accToken}}
###
GET {{$dotenv cf_url}}/v3/domains
Authorization: Bearer {{accToken}}
###
# Documentation at:
# https://help.sap.com/docs/TRANSPORT_MANAGEMENT_SERVICE/7f7160ec0d8546c6b3eab72fb5ad6fd8/c9905c142cf14aea86fe2451434faed9.html?locale=en-US
GET {{$dotenv cf_deploy}}{{$dotenv cf_deploy_path}}
Authorization: Bearer {{accToken}}
###
GET {{$dotenv cf_deploy}}/public/ping
### CAP
### Read Metadata OData V4
GET http://localhost:4004/odata/v4/admin/readOrganizations()
Authorization: Basic admin: