Class: Conjur::Host

Inherits:
Deputy
  • Object
show all
Defined in:
lib/conjur/host.rb

Overview

This class represents a Conjur Host asset. You should not create Host instances directly, but use API methods such as API#create_host and API#host.

Instance Method Summary collapse

Methods inherited from Deputy

#api_key, #login

Methods included from ActsAsResource

#deny, #permit, #resource, #resource_kind, #resourceid

Methods included from ActsAsUser

#api, #api_key, #rotate_api_key, #set_cidr_restrictions

Methods included from ActsAsRole

#can, #cannot, #role, #role_kind, #roleid

Methods included from HasAttributes

#attributes, #invalidate, #refresh, #save, #to_json

Methods included from HasIdentifier

#identifier

Methods included from HasId

#id

Methods included from Exists

#exists?

Instance Method Details

#update(options)

Note:

This feature requires Conjur server version 4.6 or later.

This method returns an undefined value.

Assign new attributes to the host. Currently, this method only lets you change the :cidr attribute.

Permissions

You must have update permission on the hosts's resource or be the host to update CIDR restrictions.

Parameters:

  • options (Hash)

    attributes to change

Options Hash (options):

  • :cidr (Array<String, IPAddr>)

    the network restrictions for this host

Raises:

  • (ArgumentError)

    if cidr isn't valid



51
52
53
54
55
# File 'lib/conjur/host.rb', line 51

def update options
  if cidr = options[:cidr]
    set_cidr_restrictions cidr
  end
end