Sha256: ac29dac22f7e31d4c2524aaa86c62dbabd256de68009274f2966329936d56583

Contents?: true

Size: 1.75 KB

Versions: 14

Compression:

Stored size: 1.75 KB

Contents

### Account Examples

If you are unfamiliar with fog, we recommend reading our [getting started](getting_started.md) guide.


#### Create a connection to SoftLayer Account Service

```ruby
	require 'fog/softlayer'
	@sl = Fog::Account[:softlayer]
```

1. Create a sub-brand (First way)
```ruby
  attributes = {
      'key_name' => "T_B",
      'long_name' => "Long Test Brand Name",
      'name' => "My name",
      'account' => {
        address1: "Street",
        city: "City",
     	companyName: "Example",
    	country: "BR",
    	email: "example@example.com",
    	firstName: "FirstName",
    	lastName: "LastName",
    	postalCode: "0000-000",
    	state: "EX"
      } 
    }
  @brand = @sl.brands.create(attributes)
```

1. Create a sub-brand (Second way)
```ruby
  attributes = {
      'key_name' => "T_B",
      'long_name' => "Long Test Brand Name",
      'name' => "My name",
      'account' => {
        address1: "Street",
        city: "City",
     	companyName: "Example",
    	country: "BR",
    	email: "example@example.com",
    	firstName: "FirstName",
    	lastName: "LastName",
    	postalCode: "0000-000",
    	state: "EX"
      } 
    }
  @brand = @sl.brands.new(attributes)
  @brand.save
```

1. Create a sub-brand (Third way)
```ruby
  attributes = {
      'key_name' => "T_B",
      'long_name' => "Long Test Brand Name",
      'name' => "My name",
      'account' => {
        address1: "Street",
        city: "City",
     	companyName: "Example",
    	country: "BR",
    	email: "example@example.com",
    	firstName: "FirstName",
    	lastName: "LastName",
    	postalCode: "0000-000",
    	state: "EX"
      } 
  }
  @brand = @sl.brands.new(attributes)
  @brand.create
```

1. Get all brand accounts
```ruby
  @brand = @sl.brands.get(id)
  @brand.get_accounts
```

Version data entries

14 entries across 12 versions & 3 rubygems

Version Path
vagrant-packet-0.1.1 vendor/bundle/ruby/2.5.0/gems/fog-softlayer-1.1.4/examples/account.md
vagrant-packet-0.1.1 vendor/bundle/ruby/2.4.0/gems/fog-softlayer-1.1.4/examples/account.md
vagrant-packet-0.1.1 vendor/bundle/ruby/2.3.0/gems/fog-softlayer-1.1.4/examples/account.md
fog-softlayer-1.1.4 examples/account.md
fog-softlayer-1.1.3 examples/account.md
fog-softlayer-1.1.2 examples/account.md
fog-softlayer-1.1.1 examples/account.md
fog-softlayer-1.1.0 examples/account.md
fog-softlayer-1.0.3 examples/account.md
fog-softlayer-1.0.2 examples/account.md
fog-softlayer-1.0.1 examples/account.md
fog-softlayer-1.0.0 examples/account.md
vagrant-cloudstack-1.2.0 vendor/bundle/gems/fog-softlayer-0.4.7/examples/account.md
fog-softlayer-0.4.7 examples/account.md