lib/nexpose/tag.rb
# Creates and saves a tag to Nexpose console
#
# @param [Connection] connection Nexpose connection
# @return [Fixnum] ID of saved tag
#
Creates and saves a tag to Nexpose console
Creates and saves a tag to Nexpose console
def save(connection)
      params = to_json
      if @id == -1
        uri = AJAX.post(connection, '/api/2.0/tags', params, AJAX::CONTENT_TYPE::JSON)
        @id = uri.split('/').last.to_i
      else
        AJAX.put(connection, "/api/2.0/tags/#{@id}", params, AJAX::CONTENT_TYPE::JSON)
      end
      @id
    end
def save ( connection ) params = to_json if @id == - 1 uri = AJAX . post ( connection , '/api/2.0/tags' , params , AJAX :: CONTENT_TYPE :: JSON ) @id = uri . split ( '/' ) . last . to_i else AJAX . put ( connection , "/api/2.0/tags/#{@id}" , params , AJAX :: CONTENT_TYPE :: JSON ) end @id end
Creates and saves a tag to Nexpose console
Creates and saves a tag to Nexpose console
ID of saved tag
ID of saved tag
Fixnum
connection
<not_specific>
<not_specific>
connection Nexpose connection
connection Nexpose connection