@@ -26,7 +26,7 @@ type CustomURL struct {
26
26
}
27
27
28
28
// Recurrance contains the information for external dynamic lists when it comes to how often they are downloaded. Method
29
- // must be one of: five-minute, hourly, daily, weekly, monthly. DayOfWeek is the name of the day, such as "tuesday." DayOfMonth
29
+ // must be one of five-minute, hourly, daily, weekly, monthly. DayOfWeek is the name of the day, such as "tuesday." DayOfMonth
30
30
// is specified as a number, ranging from 1-31. Hour must be in 23-hour format, such as "03" for 3 am. The hourly and five-minute
31
31
// methods do not require any additional fields. DayOfWeek and DayOfMonth both require the Hour field as well.
32
32
type Recurrance struct {
@@ -177,7 +177,7 @@ func (p *PaloAlto) URLCategory(devicegroup ...string) (*URLCategory, error) {
177
177
}
178
178
179
179
// CreateURLCategory creates a custom URL category to be used in a policy. When specifying multiple URL's, use a
180
- // []string variable for the url parameter (i.e . members := []string{"www.*.com", "*.somesite.net"}). If creating a
180
+ // []string variable for the url parameter (e.g . members := []string{"www.*.com", "*.somesite.net"}). If creating a
181
181
// URL category on a Panorama device, specify the device-group as the last parameter.
182
182
func (p * PaloAlto ) CreateURLCategory (name string , urls []string , description string , devicegroup ... string ) error {
183
183
var xpath string
@@ -225,7 +225,7 @@ func (p *PaloAlto) CreateURLCategory(name string, urls []string, description str
225
225
return nil
226
226
}
227
227
228
- // EditURLCategory adds or removes URL's from the given custom URL category. Action must be " add" or " remove." If editing
228
+ // EditURLCategory adds or removes URL's from the given custom URL category. Action must be add or remove If editing
229
229
// a URL category on a Panorama device, specify the device-group as the last parameter.
230
230
func (p * PaloAlto ) EditURLCategory (action , url , name string , devicegroup ... string ) error {
231
231
var xpath string
@@ -337,8 +337,8 @@ func (p *PaloAlto) DeleteURLCategory(name string, devicegroup ...string) error {
337
337
return nil
338
338
}
339
339
340
- // EditGroup will add or remove objects from the specified group type (i.e ., "address" or "service"). Action must be
341
- // " add" or " remove." If editing a group on a Panorama device, specify the device-group as the last parameter.
340
+ // EditGroup will add or remove objects from the specified group type (e.g ., "address" or "service"). Action must be
341
+ // add or remove. If editing a group on a Panorama device, specify the device-group as the last parameter.
342
342
func (p * PaloAlto ) EditGroup (objecttype , action , object , group string , devicegroup ... string ) error {
343
343
var xmlBody string
344
344
var xpath string
@@ -430,8 +430,11 @@ func (p *PaloAlto) EditGroup(objecttype, action, object, group string, devicegro
430
430
}
431
431
432
432
// RenameObject will rename the given object from oldname to the newname. You can rename the following
433
- // object types: address, address-groups, service, service-groups, tags. If renaming objects on a
434
- // Panorama device, specify the device-group as the last parameter.
433
+ // object types:
434
+ //
435
+ // address, address-groups, service, service-groups, tags.
436
+ //
437
+ // If renaming objects on a Panorama device, specify the device-group as the last parameter.
435
438
func (p * PaloAlto ) RenameObject (oldname , newname string , devicegroup ... string ) error {
436
439
var xpath string
437
440
var reqError requestError
@@ -769,9 +772,13 @@ func (p *PaloAlto) RenameObject(oldname, newname string, devicegroup ...string)
769
772
return nil
770
773
}
771
774
772
- // CreateExternalDynamicList will create an external dynamic list on the device. Listtype must be one of: ip, domain, or url. Configuring the
773
- // recurrance requires you to use the Recurrance struct when passing the configuration for this parameter - please see the documentation for that struct.
774
- // If creating an EDL on a Panorama device, specify the device-group as the last parameter.
775
+ // CreateExternalDynamicList will create an external dynamic list on the device. Listtype must be one of:
776
+ //
777
+ // ip, domain, or url
778
+ //
779
+ // Configuring the recurrance requires you to use the `Recurrance` struct when passing the configuration for this
780
+ // parameter - please see the documentation for that struct. If creating an EDL on a Panorama device, specify
781
+ // the device-group as the last parameter.
775
782
func (p * PaloAlto ) CreateExternalDynamicList (listtype string , name string , url string , recurrance * Recurrance , devicegroup ... string ) error {
776
783
var xpath string
777
784
var reqError requestError
@@ -925,9 +932,12 @@ func (p *PaloAlto) Tags(devicegroup ...string) (*Tags, error) {
925
932
926
933
}
927
934
928
- // CreateTag will add a new tag to the device. You can use the following colors: Red, Green, Blue, Yellow, Copper,
929
- // Orange, Purple, Gray, Light Green, Cyan, Light Gray, Blue Gray, Lime, Black, Gold, Brown. If creating a tag on a
930
- // Panorama device, specify the device-group as the last parameter.
935
+ // CreateTag will add a new tag to the device. You can use the following colors:
936
+ //
937
+ // Red, Green, Blue, Yellow, Copper, Orange, Purple, Gray, Light Green, Cyan, Light Gray,
938
+ // Blue Gray, Lime, Black, Gold, Brown.
939
+ //
940
+ // If creating a tag on a Panorama device, specify the device-group as the last parameter.
931
941
func (p * PaloAlto ) CreateTag (name , color , comments string , devicegroup ... string ) error {
932
942
var xmlBody string
933
943
var xpath string
@@ -1767,7 +1777,7 @@ func (p *PaloAlto) SecurityProfileGroups() (*SecurityGroups, error) {
1767
1777
}
1768
1778
1769
1779
// ApplyLogForwardingProfile will apply a Log Forwarding profile to every rule in the policy for the given device-group.
1770
- // If you wish to apply it to a single rule, instead of every rule in the policy, you can optionally specify the rule name as the last parameter.
1780
+ // If you wish to apply it to a single rule, instead of every rule in the policy, you can ( optionally) specify the rule name as the last parameter.
1771
1781
// For policies with a large number of rules, this process may take a few minutes to complete.
1772
1782
func (p * PaloAlto ) ApplyLogForwardingProfile (logprofile , devicegroup string , rule ... string ) error {
1773
1783
if p .DeviceType != "panorama" {
@@ -1919,10 +1929,14 @@ func (p *PaloAlto) ApplyLogForwardingProfile(logprofile, devicegroup string, rul
1919
1929
return nil
1920
1930
}
1921
1931
1922
- // ApplySecurityProfile will apply the following security profiles: URL Filtering, File-Blocking, Antivirus, Anti-Spyware, Vulnerability, Wildfire
1923
- // to every rule in the policy for the given device-group. If you wish to apply it to a single rule, instead of every
1924
- // rule in the policy, you can optionally specify the rule name as the last parameter. You can also specify a security group profile instead of individual profiles.
1925
- // This is done by ONLY populating the "Group" field in the SecurityProfiles struct. For policies with a large number of rules,
1932
+ // ApplySecurityProfile will apply the following security profiles to every rule in teh policy for the given
1933
+ // device-group:
1934
+ //
1935
+ // URL Filtering, File-Blocking, Antivirus, Anti-Spyware, Vulnerability, Wildfire
1936
+ //
1937
+ // If you wish to apply it to a single rule, instead of every rule in the policy, you can (optionally) specify
1938
+ // the rule name as the last parameter. You can also specify a security group profile instead of individual profiles.
1939
+ // This is done by ONLY populating the Group field in the SecurityProfiles struct. For policies with a large number of rules,
1926
1940
// this process may take a few minutes to complete.
1927
1941
func (p * PaloAlto ) ApplySecurityProfile (secprofiles * SecurityProfiles , devicegroup string , rule ... string ) error {
1928
1942
if p .DeviceType != "panorama" {
@@ -2251,27 +2265,12 @@ func (p *PaloAlto) ApplySecurityProfile(secprofiles *SecurityProfiles, devicegro
2251
2265
}
2252
2266
2253
2267
// CreateObjectsFromCsv takes a CSV file and creates the given address or service objects, and
2254
- // address or service groups defined within. See https://github.com/scottdware/go-panos#creating-objects-from-a-csv-file
2255
- // for more detailed examples.
2256
- //
2257
- // The format of the CSV file must follow this layout:
2268
+ // address or service groups defined within. The format of the CSV file must follow this layout:
2258
2269
//
2259
2270
// name,type,value,description (optional),tag (optional),device-group
2260
2271
//
2261
- // For the type column, you can specify: 'ip', 'range', 'fqdn' for address objects, and 'tcp' or 'udp' for service
2262
- // objects. For address group objects, you must specify either 'static' or 'dynamic'. And for service groups,
2263
- // you must specify 'service'. The description and tag columns are optional, so just leave them blank if you do not
2264
- // need them.
2265
- //
2266
- // If you are creating an address group, then the value field must contain the following:
2267
- //
2268
- // For a static address group: list of members to add separated by a space, i.e.: ip-host1 ip-net1 fqdn-example.com
2269
- // For a dynamic address group: the criteria (tags) to match on, i.e.: web-servers or db-servers and linux
2270
- //
2271
- // If you are creating a service group, then the value field must contain a list of service objects to add, separated by a space.
2272
- //
2273
- // If any of the objects you are creating need to be shared objects, then specify the word "shared" in the device-group (last)
2274
- // column.
2272
+ // See https://github.com/scottdware/go-panos#creating-objects-from-a-csv-file
2273
+ // for complete documentation and examples.
2275
2274
func (p * PaloAlto ) CreateObjectsFromCsv (file string ) error {
2276
2275
c , err := easycsv .Open (file )
2277
2276
if err != nil {
@@ -2455,16 +2454,12 @@ func (p *PaloAlto) CreateObjectsFromCsv(file string) error {
2455
2454
}
2456
2455
2457
2456
// ModifyGroupsFromCsv takes a CSV file and modifies the given address or service groups with the
2458
- // specified action. See https://github.com/scottdware/go-panos#modifying-object-groups-from-a-csv-file
2459
- // for more detailed examples.
2460
- //
2461
- // The format of the CSV file must follow this layout:
2457
+ // specified action. The format of the CSV file must follow this layout:
2462
2458
//
2463
2459
// grouptype,action,object-name,group-name,device-group
2464
2460
//
2465
- // For the grouptype column, you must specify 'address' or 'service'. Action must be either 'add' or 'remove'.
2466
- //
2467
- // If modifying groups on a Panorama device, specify the device-group column in the CSV file.
2461
+ // See https://github.com/scottdware/go-panos#modifying-object-groups-from-a-csv-file
2462
+ // for complete documentation and examples.
2468
2463
func (p * PaloAlto ) ModifyGroupsFromCsv (file string ) error {
2469
2464
c , err := easycsv .Open (file )
2470
2465
if err != nil {
0 commit comments