コード例 #1
0
func fillIcmpFields(d *schema.ResourceData, aclRule *cloudca.NetworkAclRule) {
	if v, ok := d.GetOk("icmp_type"); ok {
		aclRule.IcmpType = strconv.Itoa(v.(int))
	}
	if v, ok := d.GetOk("icmp_code"); ok {
		aclRule.IcmpCode = strconv.Itoa(v.(int))
	}
}
コード例 #2
0
func fillPortFields(d *schema.ResourceData, aclRule *cloudca.NetworkAclRule) {
	if v, ok := d.GetOk("start_port"); ok {
		aclRule.StartPort = strconv.Itoa(v.(int))
	}
	if v, ok := d.GetOk("end_port"); ok {
		aclRule.EndPort = strconv.Itoa(v.(int))
	}
}