Search in sources :

Example 1 with RbacAuthorizationV1beta1Api

use of io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api in project pravega by pravega.

the class K8sClient method createClusterRoleBinding.

/**
 * Create cluster role binding.
 * @param binding The cluster role binding.
 * @return A future indicating the status of the create role binding operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1ClusterRoleBinding> createClusterRoleBinding(V1beta1ClusterRoleBinding binding) {
    RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
    K8AsyncCallback<V1beta1ClusterRoleBinding> callback = new K8AsyncCallback<>("createClusterRoleBinding-" + binding.getMetadata().getName());
    api.createClusterRoleBindingAsync(binding, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : V1beta1ClusterRoleBinding(io.kubernetes.client.openapi.models.V1beta1ClusterRoleBinding) RbacAuthorizationV1beta1Api(io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api) SneakyThrows(lombok.SneakyThrows)

Example 2 with RbacAuthorizationV1beta1Api

use of io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api in project pravega by pravega.

the class K8sClient method createRole.

/**
 * Create a role.
 * @param namespace Namespace where the role is created.
 * @param role Role.
 * @return A future indicating the status of this operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1Role> createRole(String namespace, V1beta1Role role) {
    RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
    K8AsyncCallback<V1beta1Role> callback = new K8AsyncCallback<>("createRole-" + role.getMetadata().getName());
    api.createNamespacedRoleAsync(namespace, role, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : V1beta1Role(io.kubernetes.client.openapi.models.V1beta1Role) RbacAuthorizationV1beta1Api(io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api) SneakyThrows(lombok.SneakyThrows)

Example 3 with RbacAuthorizationV1beta1Api

use of io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api in project pravega by pravega.

the class K8sClient method createRoleBinding.

/**
 * Create role binding.
 * @param namespace The namespace where the binding should be created.
 * @param binding The cluster role binding.
 * @return A future indicating the status of the create role binding operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1RoleBinding> createRoleBinding(String namespace, V1beta1RoleBinding binding) {
    RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
    K8AsyncCallback<V1beta1RoleBinding> callback = new K8AsyncCallback<>("createRoleBinding-" + binding.getMetadata().getName());
    api.createNamespacedRoleBindingAsync(namespace, binding, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : RbacAuthorizationV1beta1Api(io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api) V1beta1RoleBinding(io.kubernetes.client.openapi.models.V1beta1RoleBinding) SneakyThrows(lombok.SneakyThrows)

Example 4 with RbacAuthorizationV1beta1Api

use of io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api in project pravega by pravega.

the class K8sClient method createClusterRole.

/**
 * Create a cluster role.
 * @param role Cluster Role.
 * @return A future indicating the status of this operation.
 */
@SneakyThrows(ApiException.class)
public CompletableFuture<V1beta1ClusterRole> createClusterRole(V1beta1ClusterRole role) {
    RbacAuthorizationV1beta1Api api = new RbacAuthorizationV1beta1Api();
    K8AsyncCallback<V1beta1ClusterRole> callback = new K8AsyncCallback<>("createClusterRole-" + role.getMetadata().getName());
    api.createClusterRoleAsync(role, PRETTY_PRINT, DRY_RUN, FIELD_MANAGER, callback);
    return exceptionallyExpecting(callback.getFuture(), isConflict, null);
}
Also used : V1beta1ClusterRole(io.kubernetes.client.openapi.models.V1beta1ClusterRole) RbacAuthorizationV1beta1Api(io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api) SneakyThrows(lombok.SneakyThrows)

Aggregations

RbacAuthorizationV1beta1Api (io.kubernetes.client.openapi.apis.RbacAuthorizationV1beta1Api)4 SneakyThrows (lombok.SneakyThrows)4 V1beta1ClusterRole (io.kubernetes.client.openapi.models.V1beta1ClusterRole)1 V1beta1ClusterRoleBinding (io.kubernetes.client.openapi.models.V1beta1ClusterRoleBinding)1 V1beta1Role (io.kubernetes.client.openapi.models.V1beta1Role)1 V1beta1RoleBinding (io.kubernetes.client.openapi.models.V1beta1RoleBinding)1