1.9.3-p392 :001 > service = Fog::Rackspace::Monitoring.new
=> #<Fog::Rackspace::Monitoring::Real:70314002500360 @rackspace_api_key="e3578b3eb4ef454ca9381c08c8767b97" @rackspace_userna...
1.9.3-p392 :002 > token = service.agent_tokens.new
=> <Fog::Rackspace::Monitoring::AgentToken
id=nil,
label=nil,
token=nil
>
1.9.3-p392 :003 > token.label = "test-token"
=> "test-token"
1.9.3-p392 :004 > token.token = "23kj42lj4l2j34j2;3lj"
=> "23kj42lj4l2j34j2;3lj"
1.9.3-p392 :005 > token.save
=> true
1.9.3-p392 :006 > token2 = service.agent_tokens.create :label => 'my-second-token', :token => 'sadfadsfasdfasdfa'
=> <Fog::Rackspace::Monitoring::AgentToken
id="4527beed9250f0eff20d4ace75536a66524c0df808f3d9236c980c99fd4d7503.772045",
label="my-second-token",
token="sadfadsfasdfasdfa"
>
The create_agent_token method is only called when the token object is saved. You can do that either using new and then saving the token using save or more commonly you would just use the create method which calls new and then save under the covers.