Class: SDM::RoleAttachments
- Inherits:
-
Object
- Object
- SDM::RoleAttachments
- Defined in:
- lib/svc.rb
Overview
RoleAttachments represent relationships between composite roles and the roles that make up those composite roles. When a composite role is attached to another role, the permissions granted to members of the composite role are augmented to include the permissions granted to members of the attached role.
Instance Method Summary collapse
-
#create(role_attachment, deadline: nil) ⇒ Object
Create registers a new RoleAttachment.
-
#delete(id, deadline: nil) ⇒ Object
Delete removes a RoleAttachment by ID.
-
#get(id, deadline: nil) ⇒ Object
Get reads one RoleAttachment by ID.
-
#initialize(host, insecure, parent) ⇒ RoleAttachments
constructor
A new instance of RoleAttachments.
-
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of RoleAttachments matching a given set of criteria.
Constructor Details
#initialize(host, insecure, parent) ⇒ RoleAttachments
Returns a new instance of RoleAttachments.
887 888 889 890 891 892 893 894 895 896 897 898 899 |
# File 'lib/svc.rb', line 887 def initialize(host, insecure, parent) begin if insecure @stub = V1::RoleAttachments::Stub.new(host, :this_channel_is_insecure) else cred = GRPC::Core::ChannelCredentials.new() @stub = V1::RoleAttachments::Stub.new(host, cred) end rescue => exception raise Plumbing::convert_error_to_porcelain(exception) end @parent = parent end |
Instance Method Details
#create(role_attachment, deadline: nil) ⇒ Object
Create registers a new RoleAttachment.
902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 |
# File 'lib/svc.rb', line 902 def create( , deadline: nil ) req = V1::RoleAttachmentCreateRequest.new() req. = Plumbing::() tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.create(req, metadata: @parent.("RoleAttachments.Create", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RoleAttachmentCreateResponse.new() resp. = Plumbing::(plumbing_response.) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#delete(id, deadline: nil) ⇒ Object
Delete removes a RoleAttachment by ID.
962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 |
# File 'lib/svc.rb', line 962 def delete( id, deadline: nil ) req = V1::RoleAttachmentDeleteRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.delete(req, metadata: @parent.("RoleAttachments.Delete", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RoleAttachmentDeleteResponse.new() resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#get(id, deadline: nil) ⇒ Object
Get reads one RoleAttachment by ID.
932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 |
# File 'lib/svc.rb', line 932 def get( id, deadline: nil ) req = V1::RoleAttachmentGetRequest.new() req.id = (id) tries = 0 plumbing_response = nil loop do begin plumbing_response = @stub.get(req, metadata: @parent.("RoleAttachments.Get", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end break end resp = RoleAttachmentGetResponse.new() resp. = Plumbing::(plumbing_response.) resp. = Plumbing::(plumbing_response.) resp.rate_limit = Plumbing::(plumbing_response.rate_limit) resp end |
#list(filter, *args, deadline: nil) ⇒ Object
List gets a list of RoleAttachments matching a given set of criteria.
991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 |
# File 'lib/svc.rb', line 991 def list( filter, *args, deadline: nil ) req = V1::RoleAttachmentListRequest.new() req. = V1::ListRequestMetadata.new() page_size_option = @parent.["PageSize"] if page_size_option.is_a? Integer req..limit = page_size_option end req.filter = Plumbing::quote_filter_args(filter, *args) resp = Enumerator::Generator.new { |g| tries = 0 loop do begin plumbing_response = @stub.list(req, metadata: @parent.("RoleAttachments.List", req), deadline: deadline) rescue => exception if (@parent.shouldRetry(tries, exception)) tries + +@parent.jitterSleep(tries) next end raise Plumbing::convert_error_to_porcelain(exception) end tries = 0 plumbing_response..each do |plumbing_item| g.yield Plumbing::(plumbing_item) end break if plumbing_response..next_cursor == "" req..cursor = plumbing_response..next_cursor end } resp end |