class VSphereAutomation::CIS::TaggingCategoryApi
Attributes
Public Class Methods
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 16 def initialize(api_client = ApiClient.default) @api_client = api_client end
Public Instance Methods
Adds the {@param.name usedByEntity} to the {@link CategoryModel#usedBy} subscribers {@term set} for the specified category. If the {@param.name usedByEntity} is already in the {@term set}, then this becomes an idempotent no-op. To invoke this {@term operation}, you need the modify {@link CategoryModel#usedBy} privilege on the category. @param category_id The identifier of the input category. @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 24 def add_to_used_by(category_id, request_body, opts = {}) add_to_used_by_with_http_info(category_id, request_body, opts) nil end
Adds the {@param.name usedByEntity} to the {@link CategoryModel#usedBy} subscribers {@term set} for the specified category. If the {@param.name usedByEntity} is already in the {@term set}, then this becomes an idempotent no-op. To invoke this {@term operation}, you need the modify {@link CategoryModel#usedBy} privilege on the category. @api private @param category_id The identifier of the input category. @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 35 def add_to_used_by_with_http_info(category_id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.add_to_used_by ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.add_to_used_by" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling TaggingCategoryApi.add_to_used_by" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}?~action=add-to-used-by'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#add_to_used_by\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Creates a category. To invoke this {@term operation}, you need the create category privilege. @param request_body @param [Hash] opts the optional parameters @return [CisTaggingCategoryCreateResult|VapiStdErrorsInvalidArgumentError|VapiStdErrorsUnauthorizedError|]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 81 def create(request_body, opts = {}) data, _status_code, _headers = create_with_http_info(request_body, opts) data end
Creates a category. To invoke this {@term operation}, you need the create category privilege. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(CisTaggingCategoryCreateResult|VapiStdErrorsInvalidArgumentError|VapiStdErrorsUnauthorizedError|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 91 def create_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.create ...' end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling TaggingCategoryApi.create" end # resource path local_var_path = '/com/vmware/cis/tagging/category' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTaggingCategoryCreateResult', '400' => 'CIS::VapiStdErrorsInvalidArgumentError', '403' => 'CIS::VapiStdErrorsUnauthorizedError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#create\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Deletes an existing category. To invoke this {@term operation}, you need the delete privilege on the category. @param category_id The identifier of category to be deleted. @param [Hash] opts the optional parameters @return [|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 138 def delete(category_id, opts = {}) delete_with_http_info(category_id, opts) nil end
Deletes an existing category. To invoke this {@term operation}, you need the delete privilege on the category. @api private @param category_id The identifier of category to be deleted. @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 148 def delete_with_http_info(category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.delete ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.delete" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:DELETE, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#delete\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Fetches the category information for the given category identifier. In order to view the category information, you need the read privilege on the category. @param category_id The identifier of the input category. @param [Hash] opts the optional parameters @return [CisTaggingCategoryResult|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 188 def get(category_id, opts = {}) data, _status_code, _headers = get_with_http_info(category_id, opts) data end
Fetches the category information for the given category identifier. In order to view the category information, you need the read privilege on the category. @api private @param category_id The identifier of the input category. @param [Hash] opts the optional parameters @return [Array<(CisTaggingCategoryResult|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 198 def get_with_http_info(category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.get ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.get" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTaggingCategoryResult', '403' => 'CIS::VapiStdErrorsUnauthorizedError', '404' => 'CIS::VapiStdErrorsNotFoundError', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#get\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Enumerates the categories in the system. To invoke this {@term operation}, you need the read privilege on the individual categories. The {@term list} will only contain those categories for which you have read privileges. @param [Hash] opts the optional parameters @return [CisTaggingCategoryListResult|]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 242 def list(opts = {}) data, _status_code, _headers = list_with_http_info(opts) data end
Enumerates all categories for which the {@param.name usedByEntity} is part of the {@link CategoryModel#usedBy} subscribers {@term set}. To invoke this {@term operation}, you need the read privilege on the individual categories. @param request_body @param [Hash] opts the optional parameters @return [CisTaggingCategoryListUsedCategoriesResult|]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 290 def list_used_categories(request_body, opts = {}) data, _status_code, _headers = list_used_categories_with_http_info(request_body, opts) data end
Enumerates all categories for which the {@param.name usedByEntity} is part of the {@link CategoryModel#usedBy} subscribers {@term set}. To invoke this {@term operation}, you need the read privilege on the individual categories. @api private @param request_body @param [Hash] opts the optional parameters @return [Array<(CisTaggingCategoryListUsedCategoriesResult|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 300 def list_used_categories_with_http_info(request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.list_used_categories ...' end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling TaggingCategoryApi.list_used_categories" end # resource path local_var_path = '/com/vmware/cis/tagging/category?~action=list-used-categories' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTaggingCategoryListUsedCategoriesResult', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#list_used_categories\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Enumerates the categories in the system. To invoke this {@term operation}, you need the read privilege on the individual categories. The {@term list} will only contain those categories for which you have read privileges. @api private @param [Hash] opts the optional parameters @return [Array<(CisTaggingCategoryListResult|, Fixnum, Hash)>] data, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 251 def list_with_http_info(opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.list ...' end # resource path local_var_path = '/com/vmware/cis/tagging/category' # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:GET, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names, :return_type => { '200' => 'CIS::CisTaggingCategoryListResult', }) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#list\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Removes the {@param.name usedByEntity} from the {@link CategoryModel#usedBy} subscribers {@term set}. If the {@param.name usedByEntity} is not using this category, then this becomes a no-op. To invoke this {@term operation}, you need the modify {@link CategoryModel#usedBy} privilege on the category. @param category_id The identifier of the input category. @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 346 def remove_from_used_by(category_id, request_body, opts = {}) remove_from_used_by_with_http_info(category_id, request_body, opts) nil end
Removes the {@param.name usedByEntity} from the {@link CategoryModel#usedBy} subscribers {@term set}. If the {@param.name usedByEntity} is not using this category, then this becomes a no-op. To invoke this {@term operation}, you need the modify {@link CategoryModel#usedBy} privilege on the category. @api private @param category_id The identifier of the input category. @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 357 def remove_from_used_by_with_http_info(category_id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.remove_from_used_by ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.remove_from_used_by" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling TaggingCategoryApi.remove_from_used_by" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}?~action=remove-from-used-by'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#remove_from_used_by\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Revokes all propagating permissions on the given category. You should then attach a direct permission with tagging privileges on the given category. To invoke this {@term operation}, you need category related privileges (direct or propagating) on the concerned category. @param category_id The identifier of the input category. @param [Hash] opts the optional parameters @return [|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 403 def revoke_propagating_permissions(category_id, opts = {}) revoke_propagating_permissions_with_http_info(category_id, opts) nil end
Revokes all propagating permissions on the given category. You should then attach a direct permission with tagging privileges on the given category. To invoke this {@term operation}, you need category related privileges (direct or propagating) on the concerned category. @api private @param category_id The identifier of the input category. @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 413 def revoke_propagating_permissions_with_http_info(category_id, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.revoke_propagating_permissions ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.revoke_propagating_permissions" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}?~action=revoke-propagating-permissions'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # form parameters form_params = {} # http body (model) post_body = nil auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:POST, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#revoke_propagating_permissions\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end
Updates an existing category. To invoke this {@term operation}, you need the edit privilege on the category. @param category_id The identifier of the category to be updated. @param request_body @param [Hash] opts the optional parameters @return [|VapiStdErrorsInvalidArgumentError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil]
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 454 def update(category_id, request_body, opts = {}) update_with_http_info(category_id, request_body, opts) nil end
Updates an existing category. To invoke this {@term operation}, you need the edit privilege on the category. @api private @param category_id The identifier of the category to be updated. @param request_body @param [Hash] opts the optional parameters @return [Array<(|VapiStdErrorsInvalidArgumentError|VapiStdErrorsUnauthorizedError|VapiStdErrorsNotFoundError|nil, Fixnum, Hash)>] nil, response status code and response headers
# File lib/vsphere-automation-cis/api/tagging_category_api.rb, line 465 def update_with_http_info(category_id, request_body, opts = {}) if @api_client.config.debugging @api_client.config.logger.debug 'Calling API: TaggingCategoryApi.update ...' end # verify the required parameter 'category_id' is set if @api_client.config.client_side_validation && category_id.nil? fail ArgumentError, "Missing the required parameter 'category_id' when calling TaggingCategoryApi.update" end # verify the required parameter 'request_body' is set if @api_client.config.client_side_validation && request_body.nil? fail ArgumentError, "Missing the required parameter 'request_body' when calling TaggingCategoryApi.update" end # resource path local_var_path = '/com/vmware/cis/tagging/category/id:{category_id}'.sub('{' + 'category_id' + '}', category_id.to_s) # query parameters query_params = {} # header parameters header_params = {} # HTTP header 'Accept' (if needed) header_params['Accept'] = @api_client.select_header_accept(['application/json']) # HTTP header 'Content-Type' header_params['Content-Type'] = @api_client.select_header_content_type(['application/json']) # form parameters form_params = {} # http body (model) post_body = @api_client.object_to_http_body(request_body) auth_names = ['api_key'] data, status_code, headers = @api_client.call_api(:PATCH, local_var_path, :header_params => header_params, :query_params => query_params, :form_params => form_params, :body => post_body, :auth_names => auth_names) if @api_client.config.debugging @api_client.config.logger.debug "API called: TaggingCategoryApi#update\nData: #{data.inspect}\nStatus code: #{status_code}\nHeaders: #{headers}" end return data, status_code, headers end