This file contains 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 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 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 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 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 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 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
// parsed results from the http response | |
@property (nonatomic, retain) NSArray *objects; | |
// detailed error | |
@property (nonatomic, retain) NSError *error; | |
// raw HTTP response information | |
@property (nonatomic, retain) NSDictionary *responseHeaders; | |
@property (nonatomic, retain) NSString *responseString; | |
@property (nonatomic, assign) NSUInteger responseStatusCode; |
This file contains 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)authenticate:(CKResultBlock)completionBlock errorBlock:(CKResultBlock)errorBlock { | |
NSDictionary *headers = [[[NSDictionary alloc] initWithObjectsAndKeys:@"rackcloud07", @"X-Auth-User", @"secret", @"X-Auth-Key", nil] autorelease]; | |
CKRequest *request = [CKRequest requestWithMap:[CKRouterMap mapWithRemotePath:@"https://auth.api.rackspacecloud.com/v1.0"]]; | |
[request addHeaders:headers]; | |
request.completionBlock = completionBlock; | |
request.errorBlock = errorBlock; | |
[request send]; |
This file contains 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)pollUntilActive:(OpenStackAccount *)account withProgress:(ASIBasicBlock)progressBlock complete:(ASIBasicBlock)completeBlock { | |
if ([self shouldBePolled]) { | |
NSString *endpoint = [account loadBalancerEndpointForRegion:self.region]; | |
__block LoadBalancerRequest *request = [LoadBalancerRequest getLoadBalancerDetailsRequest:account loadBalancer:self endpoint:endpoint]; | |
request.delegate = self; | |
[request setCompletionBlock:^{ | |
if ([request isSuccess]) { | |
LoadBalancer *newLB = [request loadBalancer:account]; | |
self.status = newLB.status; |
This file contains 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)deleteNodes:(NSArray *)nodesToDelete withProgress:(ASIBasicBlock)progressBlock { | |
NSString *endpoint = [self.account loadBalancerEndpointForRegion:self.loadBalancer.region]; | |
__block int deleteIndex = 0; | |
void (^deleteNodeBlock)(LoadBalancerNode *node) = ^(LoadBalancerNode *node) { | |
APICallback *callback = [self.account.manager deleteLBNode:node loadBalancer:self.loadBalancer endpoint:endpoint]; | |
[callback success:^(OpenStackRequest *request) { | |
deleteIndex++; | |
progressBlock(); |