lib/ruby_nsx_cli/nsx_objects/nsxobject.rb
def delete(api_endpoint:)

      @logger.info("Deleting NSX object: #{self.class}...")
      @logger.debug("Sending request to: #{@nsx_manager_url}...")
      @logger.debug("API endpoint is: #{api_endpoint}")

      begin
        resp = create_new_request(api_endpoint, nil).delete

        if resp.code >= 200 && resp.code < 300
          @logger.info("Successfully deleted NSX object: #{self.class}")
          return resp
        else
          raise "Unexpected return code during NSX object creation: #{self.class} returned #{resp.code}"
        end

      rescue RestClient::ExceptionWithResponse => err
        puts "Failed to create NSX object: #{self.class}"
        puts "Response code: #{err.http_code}"
        puts "Response: #{err.message}"
        return resp
      end

    end
# Deletes an NSX object using the NSX API.
#
# @param api_endpoint [String] NSX endpoint to send the request
# @return [RestClient::Response] Response from the NSX API.
Deletes an NSX object using the NSX API.
Deletes an NSX object using the NSX API .
def delete(api_endpoint:)
      @logger.info("Deleting NSX object: #{self.class}...")
      @logger.debug("Sending request to: #{@nsx_manager_url}...")
      @logger.debug("API endpoint is: #{api_endpoint}")
      begin
        resp = create_new_request(api_endpoint, nil).delete
        if resp.code >= 200 && resp.code < 300
          @logger.info("Successfully deleted NSX object: #{self.class}")
          return resp
        else
          raise "Unexpected return code during NSX object creation: #{self.class} returned #{resp.code}"
        end
      rescue RestClient::ExceptionWithResponse => err
        puts "Failed to create NSX object: #{self.class}"
        puts "Response code: #{err.http_code}"
        puts "Response: #{err.message}"
        return resp
      end
    end
def delete ( api_endpoint : ) @logger . info ( "Deleting NSX object: #{self.class}..." ) @logger . debug ( "Sending request to: #{@nsx_manager_url}..." ) @logger . debug ( "API endpoint is: #{api_endpoint}" ) begin resp = create_new_request ( api_endpoint , nil ) . delete if resp . code >= 200 && resp . code < 300 @logger . info ( "Successfully deleted NSX object: #{self.class}" ) return resp else raise "Unexpected return code during NSX object creation: #{self.class} returned #{resp.code}" end rescue RestClient :: ExceptionWithResponse => err puts "Failed to create NSX object: #{self.class}" puts "Response code: #{err.http_code}" puts "Response: #{err.message}" return resp end end
Deletes an NSX object using the NSX API.
Deletes an NSX object using the NSX API .
Response from the NSX API.
Response from the NSX API .
RestClient::Response
api_endpoint
NSX endpoint to send the request
NSX endpoint to send the request