generateRuleConfiguration
inline suspend fun NetworkSecurityManagerClient.generateRuleConfiguration(crossinline block: GenerateRuleConfigurationRequest.Builder.() -> Unit): GenerateRuleConfigurationResponse
Generates a rule configuration from a natural-language description. Provide a prompt along with the rule's firewall type and rule type. The service returns a configuration that you can use when you create or update a rule. If you also provide an existing configuration, the service edits that configuration instead of generating a new one.
Samples
// Generates a firewall rule configuration from a natural language description. The response contains
// the generated configuration as a JSON string, ready to use as the configuration of a rule.
val resp = networkSecurityManagerClient.generateRuleConfiguration {
prompt = "Create a rate limiting rule that blocks IP addresses sending more than 2000 requests in 5 minutes"
ruleFirewallType = RuleFirewallType.fromValue("WAF")
ruleType = RuleType.fromValue("INSPECTION")
clientToken = "550e8400-e29b-41d4-a716-446655440015"
}Content copied to clipboard