Skip to content

Commit ce6c8aa

Browse files
feat(orgpolicy): update the api
#### orgpolicy:v2 The following keys were added: - resources.organizations.resources.customConstraints.methods.patch (Total Keys: 12) - schemas.GoogleCloudOrgpolicyV2CustomConstraint (Total Keys: 10)
1 parent b5eda93 commit ce6c8aa

File tree

3 files changed

+236
-1
lines changed

3 files changed

+236
-1
lines changed
Lines changed: 135 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,135 @@
1+
<html><body>
2+
<style>
3+
4+
body, h1, h2, h3, div, span, p, pre, a {
5+
margin: 0;
6+
padding: 0;
7+
border: 0;
8+
font-weight: inherit;
9+
font-style: inherit;
10+
font-size: 100%;
11+
font-family: inherit;
12+
vertical-align: baseline;
13+
}
14+
15+
body {
16+
font-size: 13px;
17+
padding: 1em;
18+
}
19+
20+
h1 {
21+
font-size: 26px;
22+
margin-bottom: 1em;
23+
}
24+
25+
h2 {
26+
font-size: 24px;
27+
margin-bottom: 1em;
28+
}
29+
30+
h3 {
31+
font-size: 20px;
32+
margin-bottom: 1em;
33+
margin-top: 1em;
34+
}
35+
36+
pre, code {
37+
line-height: 1.5;
38+
font-family: Monaco, 'DejaVu Sans Mono', 'Bitstream Vera Sans Mono', 'Lucida Console', monospace;
39+
}
40+
41+
pre {
42+
margin-top: 0.5em;
43+
}
44+
45+
h1, h2, h3, p {
46+
font-family: Arial, sans serif;
47+
}
48+
49+
h1, h2, h3 {
50+
border-bottom: solid #CCC 1px;
51+
}
52+
53+
.toc_element {
54+
margin-top: 0.5em;
55+
}
56+
57+
.firstline {
58+
margin-left: 2 em;
59+
}
60+
61+
.method {
62+
margin-top: 1em;
63+
border: solid 1px #CCC;
64+
padding: 1em;
65+
background: #EEE;
66+
}
67+
68+
.details {
69+
font-weight: bold;
70+
font-size: 14px;
71+
}
72+
73+
</style>
74+
75+
<h1><a href="orgpolicy_v2.html">Organization Policy API</a> . <a href="orgpolicy_v2.organizations.html">organizations</a> . <a href="orgpolicy_v2.organizations.customConstraints.html">customConstraints</a></h1>
76+
<h2>Instance Methods</h2>
77+
<p class="toc_element">
78+
<code><a href="#close">close()</a></code></p>
79+
<p class="firstline">Close httplib2 connections.</p>
80+
<p class="toc_element">
81+
<code><a href="#patch">patch(name, body=None, x__xgafv=None)</a></code></p>
82+
<p class="firstline">Updates a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.</p>
83+
<h3>Method Details</h3>
84+
<div class="method">
85+
<code class="details" id="close">close()</code>
86+
<pre>Close httplib2 connections.</pre>
87+
</div>
88+
89+
<div class="method">
90+
<code class="details" id="patch">patch(name, body=None, x__xgafv=None)</code>
91+
<pre>Updates a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.
92+
93+
Args:
94+
name: string, Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : &quot;organizations/123/customConstraints/custom.createOnlyE2TypeVms&quot; (required)
95+
body: object, The request body.
96+
The object takes the form of:
97+
98+
{ # A custom constraint defined by customers which can *only* be applied to the given resource types and organization. By creating a custom constraint, customers can applied policies of this custom constraint. *Creating a custom constraint itself does NOT apply any policy enforcement*.
99+
&quot;actionType&quot;: &quot;A String&quot;, # Allow or deny type.
100+
&quot;condition&quot;: &quot;A String&quot;, # Org policy condition/expression. For example: `resource.instanceName.matches(&quot;[production|test]_.*_(\d)+&quot;)&#x27;` or, `resource.management.auto_upgrade == true`
101+
&quot;description&quot;: &quot;A String&quot;, # Detailed information about this custom policy constraint.
102+
&quot;displayName&quot;: &quot;A String&quot;, # One line display name for the UI.
103+
&quot;methodTypes&quot;: [ # All the operations being applied for this constraint.
104+
&quot;A String&quot;,
105+
],
106+
&quot;name&quot;: &quot;A String&quot;, # Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : &quot;organizations/123/customConstraints/custom.createOnlyE2TypeVms&quot;
107+
&quot;resourceTypes&quot;: [ # Immutable. The Resource Instance type on which this policy applies to. Format will be of the form : &quot;/&quot; Example: * `compute.googleapis.com/Instance`.
108+
&quot;A String&quot;,
109+
],
110+
}
111+
112+
x__xgafv: string, V1 error format.
113+
Allowed values
114+
1 - v1 error format
115+
2 - v2 error format
116+
117+
Returns:
118+
An object of the form:
119+
120+
{ # A custom constraint defined by customers which can *only* be applied to the given resource types and organization. By creating a custom constraint, customers can applied policies of this custom constraint. *Creating a custom constraint itself does NOT apply any policy enforcement*.
121+
&quot;actionType&quot;: &quot;A String&quot;, # Allow or deny type.
122+
&quot;condition&quot;: &quot;A String&quot;, # Org policy condition/expression. For example: `resource.instanceName.matches(&quot;[production|test]_.*_(\d)+&quot;)&#x27;` or, `resource.management.auto_upgrade == true`
123+
&quot;description&quot;: &quot;A String&quot;, # Detailed information about this custom policy constraint.
124+
&quot;displayName&quot;: &quot;A String&quot;, # One line display name for the UI.
125+
&quot;methodTypes&quot;: [ # All the operations being applied for this constraint.
126+
&quot;A String&quot;,
127+
],
128+
&quot;name&quot;: &quot;A String&quot;, # Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : &quot;organizations/123/customConstraints/custom.createOnlyE2TypeVms&quot;
129+
&quot;resourceTypes&quot;: [ # Immutable. The Resource Instance type on which this policy applies to. Format will be of the form : &quot;/&quot; Example: * `compute.googleapis.com/Instance`.
130+
&quot;A String&quot;,
131+
],
132+
}</pre>
133+
</div>
134+
135+
</body></html>

docs/dyn/orgpolicy_v2.organizations.html

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -79,6 +79,11 @@ <h2>Instance Methods</h2>
7979
</p>
8080
<p class="firstline">Returns the constraints Resource.</p>
8181

82+
<p class="toc_element">
83+
<code><a href="orgpolicy_v2.organizations.customConstraints.html">customConstraints()</a></code>
84+
</p>
85+
<p class="firstline">Returns the customConstraints Resource.</p>
86+
8287
<p class="toc_element">
8388
<code><a href="orgpolicy_v2.organizations.policies.html">policies()</a></code>
8489
</p>

googleapiclient/discovery_cache/documents/orgpolicy.v2.json

Lines changed: 96 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -362,6 +362,38 @@
362362
}
363363
}
364364
},
365+
"customConstraints": {
366+
"methods": {
367+
"patch": {
368+
"description": "Updates a Custom Constraint. Returns a `google.rpc.Status` with `google.rpc.Code.NOT_FOUND` if the constraint does not exist. Note: the supplied policy will perform a full overwrite of all fields.",
369+
"flatPath": "v2/organizations/{organizationsId}/customConstraints/{customConstraintsId}",
370+
"httpMethod": "PATCH",
371+
"id": "orgpolicy.organizations.customConstraints.patch",
372+
"parameterOrder": [
373+
"name"
374+
],
375+
"parameters": {
376+
"name": {
377+
"description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\"",
378+
"location": "path",
379+
"pattern": "^organizations/[^/]+/customConstraints/[^/]+$",
380+
"required": true,
381+
"type": "string"
382+
}
383+
},
384+
"path": "v2/{+name}",
385+
"request": {
386+
"$ref": "GoogleCloudOrgpolicyV2CustomConstraint"
387+
},
388+
"response": {
389+
"$ref": "GoogleCloudOrgpolicyV2CustomConstraint"
390+
},
391+
"scopes": [
392+
"https://www.googleapis.com/auth/cloud-platform"
393+
]
394+
}
395+
}
396+
},
365397
"policies": {
366398
"methods": {
367399
"create": {
@@ -751,7 +783,7 @@
751783
}
752784
}
753785
},
754-
"revision": "20211118",
786+
"revision": "20211203",
755787
"rootUrl": "https://orgpolicy.googleapis.com/",
756788
"schemas": {
757789
"GoogleCloudOrgpolicyV2Constraint": {
@@ -816,6 +848,69 @@
816848
},
817849
"type": "object"
818850
},
851+
"GoogleCloudOrgpolicyV2CustomConstraint": {
852+
"description": "A custom constraint defined by customers which can *only* be applied to the given resource types and organization. By creating a custom constraint, customers can applied policies of this custom constraint. *Creating a custom constraint itself does NOT apply any policy enforcement*.",
853+
"id": "GoogleCloudOrgpolicyV2CustomConstraint",
854+
"properties": {
855+
"actionType": {
856+
"description": "Allow or deny type.",
857+
"enum": [
858+
"ACTION_TYPE_UNSPECIFIED",
859+
"ALLOW",
860+
"DENY"
861+
],
862+
"enumDescriptions": [
863+
"Unspecified. Will results in user error.",
864+
"Allowed action type.",
865+
"Deny action type."
866+
],
867+
"type": "string"
868+
},
869+
"condition": {
870+
"description": "Org policy condition/expression. For example: `resource.instanceName.matches(\"[production|test]_.*_(\\d)+\")'` or, `resource.management.auto_upgrade == true`",
871+
"type": "string"
872+
},
873+
"description": {
874+
"description": "Detailed information about this custom policy constraint.",
875+
"type": "string"
876+
},
877+
"displayName": {
878+
"description": "One line display name for the UI.",
879+
"type": "string"
880+
},
881+
"methodTypes": {
882+
"description": "All the operations being applied for this constraint.",
883+
"items": {
884+
"enum": [
885+
"METHOD_TYPE_UNSPECIFIED",
886+
"CREATE",
887+
"UPDATE",
888+
"DELETE"
889+
],
890+
"enumDescriptions": [
891+
"Unspecified. Will results in user error.",
892+
"Constraint applied when creating the resource.",
893+
"Constraint applied when updating the resource.",
894+
"Constraint applied when deleting the resource."
895+
],
896+
"type": "string"
897+
},
898+
"type": "array"
899+
},
900+
"name": {
901+
"description": "Immutable. Name of the constraint. This is unique within the organization. Format of the name should be * `organizations/{organization_id}/customConstraints/{custom_constraint_id}` Example : \"organizations/123/customConstraints/custom.createOnlyE2TypeVms\"",
902+
"type": "string"
903+
},
904+
"resourceTypes": {
905+
"description": "Immutable. The Resource Instance type on which this policy applies to. Format will be of the form : \"/\" Example: * `compute.googleapis.com/Instance`.",
906+
"items": {
907+
"type": "string"
908+
},
909+
"type": "array"
910+
}
911+
},
912+
"type": "object"
913+
},
819914
"GoogleCloudOrgpolicyV2ListConstraintsResponse": {
820915
"description": "The response returned from the ListConstraints method.",
821916
"id": "GoogleCloudOrgpolicyV2ListConstraintsResponse",

0 commit comments

Comments
 (0)