This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsViewController.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsViewController.h" | |
#import "RSAccount.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsDataSource.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsDataSource.h" | |
#import "RSAccount.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsDataSource.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsDataSource.h" | |
#import "RSAccount.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsViewController.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsViewController.h" | |
#import "RSAccountsDataSource.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)loginButtonPressed:(id)sender { | |
// this is obviously temporary until we decide on UI for this :) | |
self.navigationItem.title = @"Authenticating..."; | |
RSAccount *account = [RSAccount blank]; | |
account.provider = self.provider; | |
account.username = self.usernameTextField.text; | |
account.api_key = self.apiKeyTextField.text; | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (IBAction)loginButtonPressed:(id)sender { | |
// this is obviously temporary until we decide on UI for this :) | |
self.navigationItem.title = @"Authenticating..."; | |
RSAccount *account = [RSAccount blank]; | |
account.provider = self.provider; | |
account.username = self.usernameTextField.text; | |
account.api_key = self.apiKeyTextField.text; |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsViewController.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsViewController.h" | |
#import "RSAccountsDataSource.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
// | |
// RSAccountsDataSource.m | |
// Rackspace | |
// | |
// Created by Michael Mayo on 9/27/11. | |
// Copyright (c) 2011 Rackspace, US Inc. All rights reserved. | |
// | |
#import "RSAccountsDataSource.h" | |
#import "RSAccount.h" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (CKRequest *)actionRequest { | |
// TODO: self.id needs to be a string instead of an int | |
CKRequest *request = [CKRequest requestWithRemotePath:$S(@"/servers/%@/action", self.id)]; | |
NSLog(@"request url: %@", request.remoteURL); | |
request.method = CKRequestMethodPOST; | |
[request addHeaders:[NSDictionary dictionaryWithObject:[[RSAccount activeAccount] api_auth_token] forKey:@"X-Auth-Token"]]; | |
return request; | |
} |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
- (void)rebuildWithImage:(RSImage *)image success:(CKBasicBlock)successBlock failure:(void (^)(CKResult *result))failureBlock { | |
CKRequest *request = [self actionRequest]; | |
[request setBodyWithJSONDict:$D($D(image.id, @"imageId"), @"rebuild")]; | |
[self send:request success:successBlock failure:failureBlock]; | |
} |