Add support for firewall rule name (#21430)

This commit is contained in:
Cheena Malhotra
2022-12-16 18:29:44 -08:00
committed by GitHub
parent e2b1e6cbf3
commit ca22686061
11 changed files with 303 additions and 85 deletions

54
src/sql/azdata.d.ts vendored
View File

@@ -2642,24 +2642,78 @@ declare module 'azdata' {
* Represents a provider of resource
*/
export interface ResourceProvider {
/**
* Creates a firewall rule for the given account
* @param account Account with which firewall rule request will be made.
* @param firewallruleInfo Firewall rule creation information
*/
createFirewallRule(account: Account, firewallruleInfo: FirewallRuleInfo): Thenable<CreateFirewallRuleResponse>;
/**
* Handles the response from the firewall rule creation request
* @param errorCode Error code from the firewall rule creation request
* @param errorMessage Error message from the firewall rule creation request
* @param connectionTypeId Connection type id of the firewall rule creation request
*/
handleFirewallRule(errorCode: number, errorMessage: string, connectionTypeId: string): Thenable<HandleFirewallRuleResponse>;
}
/**
* Firewall rule creation information
*/
export interface FirewallRuleInfo {
/**
* Start of the IP address range
*/
startIpAddress?: string | undefined;
/**
* End of the IP address range
*/
endIpAddress?: string | undefined;
/**
* Fully qualified name of the server to create a new firewall rule on
*/
serverName: string;
/**
* Firewall rule name to set
*/
firewallRuleName: string;
/**
* Per-tenant token mappings. Ideally would be set independently of this call,
* but for now this allows us to get the tokens necessary to find a server and open a firewall rule
*/
securityTokenMappings: {};
}
/**
* Firewall rule creation response
*/
export interface CreateFirewallRuleResponse {
/**
* Whether or not request can be handled.
*/
result: boolean;
/**
* Contains error message, if request could not be handled.
*/
errorMessage: string;
}
/**
* Response to the check for Firewall rule support given an error message
*/
export interface HandleFirewallRuleResponse {
/**
* Whether or not request can be handled.
*/
result: boolean;
/**
* Contains error message, if request could not be handled.
*/
errorMessage: string;
/**
* If handled, the default IP address to send back; so users can tell what their blocked IP is.
*/
ipAddress: string;
}