Sha256: 736ea424f6820ae8e0b7e6c4189418ef3ae76649acba0decd8142fbbebe4c54a

Contents?: true

Size: 513 Bytes

Versions: 1

Compression:

Stored size: 513 Bytes

Contents

class FleetAPI::Client::Unit < FleetAPI::Model
  identity :name

  attribute :machineID
  attribute :currentState
  attribute :desiredState
  attribute :options

  def save
    requires :name
    params = {
      "desiredState" => self.desiredState,
      "options" => self.options,
      "name" => self.name
    }

    unless self.machineID # hax
      request_attributes = connection.create_unit(params).body
    else
      params["name"] = self.name
      self.connection.update_unit(params)
    end
  end
end

Version data entries

1 entries across 1 versions & 1 rubygems

Version Path
coreos-fleet-api-0.1.0 lib/fleet_api/models/unit.rb