Skip to content

Commit a82c6ab

Browse files
bring v2 to main standard
2 parents 27fdf3e + e469511 commit a82c6ab

7 files changed

+199
-3
lines changed

CLA.md

+52
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,52 @@
1+
Contributions to Splunk
2+
In order to contribute to a Splunk open source project, please:
3+
4+
Read the agreement below
5+
Fill out the form
6+
Indicate your acceptance of the terms
7+
Then proceed to the GitHub and issue an pull request (if you haven't already) for the project or projects that you would like to contribute to and we will take it from there.
8+
9+
10+
11+
Splunk Contributor License Agreement ("Agreement")
12+
You accept and agree to the following terms and conditions for Your present and future Contributions submitted to Splunk Inc. ("Splunk"). Except for the license granted herein to Splunk and recipients of software distributed by Splunk, You reserve all right, title, and interest in and to Your Contributions.
13+
14+
15+
16+
1. Definitions.
17+
18+
19+
20+
"You" (or "Your") shall mean the copyright owner or legal entity authorized by the copyright owner that is making this Agreement with Splunk. For legal entities, the entity making a Contribution and all other entities that control, are controlled by, or are under common control with that entity are considered to be a single Contributor. For the purposes of this definition, "control" means (i) the power, direct or indirect, to cause the direction or management of such entity, whether by contract or otherwise, or (ii) ownership of fifty percent (50%) or more of the outstanding shares, or (iii) beneficial ownership of such entity.
21+
22+
23+
24+
"Contribution" shall mean any original work of authorship, including any modifications or additions to an existing work, that is intentionally submitted by You to Splunk for inclusion in, or documentation of, any of the products owned or managed by Splunk (the "Work"). For the purposes of this definition, "submitted" means any form of electronic, verbal, or written communication sent to Splunk or its representatives, including but not limited to communication on electronic mailing lists, source code control systems, and issue tracking systems that are managed by, or on behalf of, Splunk for the purpose of discussing and improving the Work, but excluding communication that is conspicuously marked or otherwise designated in writing by You as "Not a Contribution."
25+
26+
27+
28+
2. Grant of Copyright License. Subject to the terms and conditions of this Agreement, You hereby grant to Splunk and to recipients of software distributed by Splunk a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable copyright license to reproduce, prepare derivative works of, publicly display, publicly perform, sublicense, and distribute Your Contributions and such derivative works.
29+
30+
31+
32+
3. Grant of Patent License. Subject to the terms and conditions of this Agreement, You hereby grant to Splunk and to recipients of software distributed by Splunk a perpetual, worldwide, non-exclusive, no-charge, royalty-free, irrevocable (except as stated in this section) patent license to make, have made, use, offer to sell, sell, import, and otherwise transfer the Work, where such license applies only to those patent claims licensable by You that are necessarily infringed by Your Contribution(s) alone or by combination of Your Contribution(s) with the Work to which such Contribution(s) was submitted. If any entity institutes patent litigation against You or any other entity (including a cross-claim or counterclaim in a lawsuit) alleging that your Contribution, or the Work to which you have contributed, constitutes direct or contributory patent infringement, then any patent licenses granted to that entity under this Agreement for that Contribution or Work shall terminate as of the date such litigation is filed.
33+
34+
35+
36+
4. You represent that you are legally entitled to grant the above license. If your employer(s) has rights to intellectual property that you create that includes your Contributions, you represent that you have received permission to make Contributions on behalf of that employer, that your employer has waived such rights for your Contributions to Splunk, or that your employer has executed a separate Corporate CLA with Splunk.
37+
38+
39+
40+
5. You represent that each of Your Contributions is Your original creation (see section 7 for submissions on behalf of others). You represent that Your Contribution submissions include complete details of any third-party license or other restriction (including, but not limited to, related patents and trademarks) of which you are personally aware and which are associated with any part of Your Contributions.
41+
42+
43+
44+
6. You are not expected to provide support for Your Contributions, except to the extent You desire to provide support. You may provide support for free, for a fee, or not at all. Unless required by applicable law or agreed to in writing, You provide Your Contributions on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied, including, without limitation, any warranties or conditions of TITLE, NON- INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A PARTICULAR PURPOSE.
45+
46+
47+
48+
7. Should You wish to submit work that is not Your original creation, You may submit it to Splunk separately from any Contribution, identifying the complete details of its source and of any license or other restriction (including, but not limited to, related patents, trademarks, and license agreements) of which you are personally aware, and conspicuously marking the work as "Submitted on behalf of a third-party: [named here]".
49+
50+
51+
52+
8. You agree to notify Splunk of any facts or circumstances of which you become aware that would make these representations inaccurate in any respect.

CODE_OF_CONDUCT.md

+76
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,76 @@
1+
# Contributor Covenant Code of Conduct
2+
3+
## Our Pledge
4+
5+
In the interest of fostering an open and welcoming environment, we as
6+
contributors and maintainers pledge to making participation in our project and
7+
our community a harassment-free experience for everyone, regardless of age, body
8+
size, disability, ethnicity, sex characteristics, gender identity and expression,
9+
level of experience, education, socio-economic status, nationality, personal
10+
appearance, race, religion, or sexual identity and orientation.
11+
12+
## Our Standards
13+
14+
Examples of behavior that contributes to creating a positive environment
15+
include:
16+
17+
* Using welcoming and inclusive language
18+
* Being respectful of differing viewpoints and experiences
19+
* Gracefully accepting constructive criticism
20+
* Focusing on what is best for the community
21+
* Showing empathy towards other community members
22+
23+
Examples of unacceptable behavior by participants include:
24+
25+
* The use of sexualized language or imagery and unwelcome sexual attention or
26+
advances
27+
* Trolling, insulting/derogatory comments, and personal or political attacks
28+
* Public or private harassment
29+
* Publishing others' private information, such as a physical or electronic
30+
address, without explicit permission
31+
* Other conduct which could reasonably be considered inappropriate in a
32+
professional setting
33+
34+
## Our Responsibilities
35+
36+
Project maintainers are responsible for clarifying the standards of acceptable
37+
behavior and are expected to take appropriate and fair corrective action in
38+
response to any instances of unacceptable behavior.
39+
40+
Project maintainers have the right and responsibility to remove, edit, or
41+
reject comments, commits, code, wiki edits, issues, and other contributions
42+
that are not aligned to this Code of Conduct, or to ban temporarily or
43+
permanently any contributor for other behaviors that they deem inappropriate,
44+
threatening, offensive, or harmful.
45+
46+
## Scope
47+
48+
This Code of Conduct applies both within project spaces and in public spaces
49+
when an individual is representing the project or its community. Examples of
50+
representing a project or community include using an official project e-mail
51+
address, posting via an official social media account, or acting as an appointed
52+
representative at an online or offline event. Representation of a project may be
53+
further defined and clarified by project maintainers.
54+
55+
## Enforcement
56+
57+
Instances of abusive, harassing, or otherwise unacceptable behavior may be
58+
reported by contacting the project team at splunk-oss-admin@splunk.com. All
59+
complaints will be reviewed and investigated and will result in a response that
60+
is deemed necessary and appropriate to the circumstances. The project team is
61+
obligated to maintain confidentiality with regard to the reporter of an incident.
62+
Further details of specific enforcement policies may be posted separately.
63+
64+
Project maintainers who do not follow or enforce the Code of Conduct in good
65+
faith may face temporary or permanent repercussions as determined by other
66+
members of the project's leadership.
67+
68+
## Attribution
69+
70+
This Code of Conduct is adapted from the [Contributor Covenant][homepage], version 1.4,
71+
available at https://www.contributor-covenant.org/version/1/4/code-of-conduct.html
72+
73+
[homepage]: https://www.contributor-covenant.org
74+
75+
For answers to common questions about this code of conduct, see
76+
https://www.contributor-covenant.org/faq

CONTRIBUTING.md

+55
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,55 @@
1+
# Contributing
2+
3+
Contributions are encouraged and greatly appreciated! Every
4+
little bit helps, and credit will always be given.
5+
6+
You can contribute in many ways:
7+
8+
## Types of Contributions
9+
10+
### Report Bugs/Issues:
11+
12+
If you are reporting a bug or issues, please include:
13+
14+
- Operating system name and version.
15+
- Any details about your local setup that might be helpful
16+
in troubleshooting (E.G. Python version if using a python script, Terraform version if you're using a Terraform script.).
17+
- Detailed steps to reproduce the bug.
18+
19+
### Fix Bugs
20+
21+
Check the Issues for this repo on GitHub. Anything tagged with
22+
a "bug" ticket type is open to whoever wants to implement it.
23+
24+
### Implement Features
25+
26+
If you have a great set of dashboards, detectors, API scripts for sending metrics, or any other content
27+
you believe will be of use to others, please contribute it!
28+
29+
Or check the Issues for this repo on GitHub. Anything tagged with "enhancement"
30+
and "help wanted" is open to whoever wants to implement it.
31+
32+
### Write Documentation
33+
34+
Submissions and `README.md` files could always use more documentation. Documentation can always use an update or tweak in the official docs, in docstrings of scripts, comments in configs, or anywhere a bit of clarity may be useful..
35+
36+
### Submit Feedback
37+
38+
If you are proposing a feature:
39+
40+
- Explain in detail how it would work.
41+
- Keep the scope as narrow as possible, to make it easier
42+
to implement.
43+
- Remember that this is a volunteer-driven project, and that
44+
contributions are welcome :)
45+
46+
## Pull Request Guidelines
47+
48+
Before you submit a pull request, check that it meets these guidelines:
49+
50+
1. The pull request should include a `README.md` for any new submission.
51+
2. If the pull request adds functionality, the `README.md` docs for that component or submission should be updated.
52+
Put your new functionality into a function with a docstring, and add
53+
the feature to the list in README.md.
54+
3. Terraform submissions should work with the most current version of the included Terraform Provider.
55+
4. Python submissions should work for Python3

syntheticsclientv2/common_models.go

+4-2
Original file line numberDiff line numberDiff line change
@@ -284,7 +284,8 @@ type HttpCheckV2Response struct {
284284
Authentication *Authentication `json:"authentication"`
285285
UserAgent *string `json:"userAgent"`
286286
Verifycertificates bool `json:"verifyCertificates"`
287-
HttpHeaders []HttpHeaders `json:"headers"`
287+
HttpHeaders []HttpHeaders `json:"headers,omitempty"`
288+
Validations []Validations `json:"validations"`
288289
} `json:"test"`
289290
}
290291

@@ -302,7 +303,8 @@ type HttpCheckV2Input struct {
302303
Authentication *Authentication `json:"authentication"`
303304
UserAgent *string `json:"userAgent"`
304305
Verifycertificates bool `json:"verifyCertificates"`
305-
HttpHeaders []HttpHeaders `json:"headers"`
306+
HttpHeaders []HttpHeaders `json:"headers,omitempty"`
307+
Validations []Validations `json:"validations"`
306308
} `json:"test"`
307309
}
308310

syntheticsclientv2/create_httpcheckv2.go

+5
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,11 @@ func parseCreateHttpCheckV2Response(response string) (*HttpCheckV2Response, erro
3333

3434
func (c Client) CreateHttpCheckV2(HttpCheckV2Details *HttpCheckV2Input) (*HttpCheckV2Response, *RequestDetails, error) {
3535

36+
if HttpCheckV2Details.Test.Validations == nil {
37+
validation := make([]Validations, 0)
38+
HttpCheckV2Details.Test.Validations = validation
39+
}
40+
3641
body, err := json.Marshal(HttpCheckV2Details)
3742
if err != nil {
3843
return nil, nil, err

syntheticsclientv2/integration_test.go

+3-1
Original file line numberDiff line numberDiff line change
@@ -245,12 +245,13 @@ func CreateHttpCheckV2(test string, c *Client) (int, error) {
245245
}
246246
fmt.Printf("\nReq was: \n%v\n", reqDetail)
247247
JsonPrint(res)
248+
inputHttpCheckV2Data = HttpCheckV2Input{}
248249

249250
return res.Test.ID, nil
250251
}
251252

252253
func UpdateHttpCheckV2(checkId int, test string, c *Client) error {
253-
254+
254255
err := json.Unmarshal([]byte(test), &inputHttpCheckV2Data)
255256
if err != nil {
256257
return err
@@ -263,6 +264,7 @@ func UpdateHttpCheckV2(checkId int, test string, c *Client) error {
263264
}
264265
fmt.Printf("\nReq was: \n%v\n", reqDetail)
265266
JsonPrint(res)
267+
inputHttpCheckV2Data = HttpCheckV2Input{}
266268

267269
return nil
268270
}

syntheticsclientv2/update_httpcheckv2.go

+4
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,10 @@ func parseUpdateHttpCheckV2Response(response string) (*HttpCheckV2Response, erro
3333
}
3434

3535
func (c Client) UpdateHttpCheckV2(id int, HttpCheckV2Details *HttpCheckV2Input) (*HttpCheckV2Response, *RequestDetails, error) {
36+
if HttpCheckV2Details.Test.Validations == nil {
37+
validation := make([]Validations, 0)
38+
HttpCheckV2Details.Test.Validations = validation
39+
}
3640

3741
body, err := json.Marshal(HttpCheckV2Details)
3842
if err != nil {

0 commit comments

Comments
 (0)