@Deprecated public interface ResourceManager extends com.google.cloud.Service<ResourceManagerOptions>
Modifier and Type | Interface and Description |
---|---|
static class |
ResourceManager.ListOption
Deprecated.
Class for specifying project list options.
|
static class |
ResourceManager.ProjectField
Deprecated.
The fields of a project.
|
static class |
ResourceManager.ProjectGetOption
Deprecated.
Class for specifying project get options.
|
static class |
ResourceManager.ProjectListOption
Deprecated.
Class for specifying project list options.
|
Modifier and Type | Field and Description |
---|---|
static String |
DEFAULT_CONTENT_TYPE
Deprecated.
|
static final String DEFAULT_CONTENT_TYPE
@Deprecated Project create(ProjectInfo project)
ProjectsClient.create(ProjectsSettings)
insteadInitially, the project resource is owned by its creator exclusively. The creator can later grant permission to others to read or update the project. Several APIs are activated automatically for the project, including Google Cloud Storage.
ResourceManagerException
- upon failure@Deprecated void delete(String projectId)
ProjectsClient.deleteProjectAsync(ProjectName)
insteadThis method will only affect the project if the following criteria are met:
ProjectInfo.State.ACTIVE
.
ProjectInfo.State.ACTIVE
to
ProjectInfo.State.DELETE_REQUESTED
. The deletion starts at an unspecified time, at
which point the lifecycle state changes to ProjectInfo.State.DELETE_IN_PROGRESS
. Until
the deletion completes, you can check the lifecycle state checked by retrieving the project
with get(java.lang.String, com.google.cloud.resourcemanager.ResourceManager.ProjectGetOption...)
, and the project remains visible to list(com.google.cloud.resourcemanager.ResourceManager.ProjectListOption...)
. However, you cannot update the project. After the deletion completes,
the project is not retrievable by the get(java.lang.String, com.google.cloud.resourcemanager.ResourceManager.ProjectGetOption...)
and list(com.google.cloud.resourcemanager.ResourceManager.ProjectListOption...)
methods. The caller must have modify permissions for this project.ResourceManagerException
- upon failure@Deprecated Project get(String projectId, ResourceManager.ProjectGetOption... options)
ProjectsClient.getProject(GetProjectRequest)
insteadReturns null
if the project is not found or if the user doesn't have read
permissions for the project.
ResourceManagerException
- upon failure@Deprecated Page<Project> list(ResourceManager.ProjectListOption... options)
ProjectsClient.listProjects(ListProjectsRequest)
insteadThis method returns projects in an unspecified order. New projects do not necessarily appear
at the end of the list. Use ResourceManager.ProjectListOption
to filter this list, set page size, and
set page tokens.
Page<Project>
, a page of projectsResourceManagerException
- upon failure@Deprecated Project replace(ProjectInfo newProject)
ProjectsClient.updateProjectAsync(UpdateProjectRequest)
insteadThe caller must have modify permissions for this project.
ResourceManagerException
- upon failure@Deprecated void undelete(String projectId)
ProjectsClient.undeleteProjectAsync(UndeleteProjectRequest)
insteadYou can only use this method for a project that has a lifecycle state of ProjectInfo.State.DELETE_REQUESTED
. After deletion starts, as indicated by a lifecycle state
of ProjectInfo.State.DELETE_IN_PROGRESS
, the project cannot be restored. The caller
must have modify permissions for this project.
ResourceManagerException
- upon failure@Deprecated com.google.cloud.Policy getPolicy(String projectId)
ProjectsClient.getIamPolicy(GetIamPolicyRequest)
insteadnull
if the
resource does not exist or if you do not have adequate permission to view the project or get
the policy.ResourceManagerException
- upon failure@Deprecated com.google.cloud.Policy replacePolicy(String projectId, com.google.cloud.Policy newPolicy)
It is recommended that you use the read-modify-write pattern. This pattern entails reading
the project's current policy, updating it locally, and then sending the modified policy for
writing. Cloud IAM solves the problem of conflicting processes simultaneously attempting to
modify a policy by using the etag
property. This property is used to
verify whether the policy has changed since the last request. When you make a request to Cloud
IAM with an etag value, Cloud IAM compares the etag value in the request with the existing etag
value associated with the policy. It writes the policy only if the etag values match. If the
etags don't match, a ResourceManagerException
is thrown, denoting that the server
aborted update. If an etag is not provided, the policy is overwritten blindly.
An example of using the read-write-modify pattern is as follows:
Policy currentPolicy = resourceManager.getPolicy("my-project-id");
Policy modifiedPolicy = current.toBuilder()
.removeIdentity(Role.viewer(), Identity.user("user@gmail.com"))
.build();
Policy newPolicy = resourceManager.replacePolicy("my-project-id", modified);
ResourceManagerException
- upon failure@Deprecated List<Boolean> testPermissions(String projectId, List<String> permissions)
ResourceManagerException
- upon failure@Deprecated Map<String,Boolean> testOrgPermissions(String resource, List<String> permissions)
resource
- the organization's resource name, e.g. "organizations/123"permissions
- the set of permissions to check for the resource. Permissions with wildcards
(such as '*' or 'storage.*') are not allowed.ResourceManagerException
- upon failurevoid clearOrgPolicy(String resource, OrgPolicyInfo orgPolicy)
ResourceManagerException
- upon failure@Deprecated OrgPolicyInfo getEffectiveOrgPolicy(String resource, String constraint)
This is the result of merging Policies in the resource hierarchy. The returned Policy will not have an etag set because it is a computed Policy across multiple resources. Subtrees of Resource Manager resource hierarchy with 'under:' prefix are not expanded.
ResourceManagerException
- upon failureOrgPolicyInfo getOrgPolicy(String resource, String constraint)
If no Policy is set on the resource, a Policy is returned with default values including POLICY_TYPE_NOT_SET for the policy_type one of. The etag value can be used with projects.setOrgPolicy() to create or update a Policy during read-modify-write.
ResourceManagerException
- upon failure@Deprecated Page<ConstraintInfo> listAvailableOrgPolicyConstraints(String resource, ResourceManager.ListOption... options)
ResourceManagerException
- upon failure@Deprecated Page<OrgPolicyInfo> listOrgPolicies(String resource, ResourceManager.ListOption... options)
ResourceManagerException
- upon failure@Deprecated OrgPolicyInfo replaceOrgPolicy(String resource, OrgPolicyInfo orgPolicy)
Not supplying an etag on the request Policy results in an unconditional write of the Policy.
ResourceManagerException
- upon failureCopyright © 2022 Google LLC. All rights reserved.