You are viewing a plain text version of this content. The canonical link for it is here.
Posted to commits@devlake.apache.org by he...@apache.org on 2023/02/14 19:36:15 UTC
[incubator-devlake-website] branch main updated: revert bitbucket docs (#417)
This is an automated email from the ASF dual-hosted git repository.
hez pushed a commit to branch main
in repository https://gitbox.apache.org/repos/asf/incubator-devlake-website.git
The following commit(s) were added to refs/heads/main by this push:
new bb56caa047 revert bitbucket docs (#417)
bb56caa047 is described below
commit bb56caa047b666f6d00bd935a3359981039ef956
Author: mindlesscloud <li...@merico.dev>
AuthorDate: Wed Feb 15 03:36:10 2023 +0800
revert bitbucket docs (#417)
* revert bitbucket docs
* remove the part of advance mode
---
docs/Plugins/bitbucket.md | 74 +++++++++++++++++------
versioned_docs/version-v0.15/Plugins/bitbucket.md | 74 +++++++++++++++++------
2 files changed, 108 insertions(+), 40 deletions(-)
diff --git a/docs/Plugins/bitbucket.md b/docs/Plugins/bitbucket.md
index b5a2979391..d010fbb624 100644
--- a/docs/Plugins/bitbucket.md
+++ b/docs/Plugins/bitbucket.md
@@ -36,32 +36,66 @@ Metrics that can be calculated based on the data collected from bitbucket:
## Configuration
- Configuring Bitbucket via [Config UI](/Configuration/BitBucket.md)
-- Configuring Bitbucket via Config UI's [advanced mode](/Configuration/AdvancedMode.md#9-BitBucket).
## API Sample Request
+> Note: Please replace the `http://localhost:8080` in the sample requests with your actual DevLake API endpoint. For how to view DevLake API's swagger documentation, please refer to the "Using DevLake API" section of [Developer Setup](../DeveloperManuals/DeveloperSetup.md).
-You can trigger data collection by making a POST request to `/pipelines`.
+1. Create a Bitbucket data connection: `POST /plugins/bitbucket/connections`. Please see a sample request below:
```shell
-curl 'http://localhost:8080/pipelines' \
+curl --location --request POST 'http://localhost:8080/plugins/bitbucket/connections' \
--header 'Content-Type: application/json' \
---data-raw '
-{
- "name": "project1",
- "plan": [
- [
- {
- "plugin": "bitbucket",
- "options": {
- "connectionId": 1,
- "owner": "apache",
- "repo": "devlake",
- }
- }
- ]
- ]
-}
-'
+--data-raw '{
+ "endpoint": "https://api.bitbucket.org/2.0/",
+ "username": "<your username>",
+ "password": "<your app password>",
+ "name": "Bitbucket Cloud"
+}'
+```
+
+2. Create a blueprint to collect data from Bitbucket: `POST /blueprints`. Please see a sample request below:
+
+```shell
+curl --location --request POST 'http://localhost:8080/blueprints' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "enable": true,
+ "mode": "NORMAL",
+ "name": "My Bitbucket Blueprint",
+ "cronConfig": "<cron string of your choice>",
+ "isManual": false,
+ "plan": [[]],
+ "settings": {
+ "connections": [
+ {
+ "plugin": "bitbucket",
+ "connectionId": 1,
+ "scope": [
+ {
+ "entities": [
+ "CODE",
+ "TICKET",
+ "CODEREVIEW",
+ "CROSS"
+ ],
+ "options": {
+ "owner": "<owner of your repo>",
+ "repo": "<your repo name>"
+ }
+ }
+ ]
+ }
+ ],
+ "version": "1.0.0"
+ }
+}'
+```
+
+3. [Optional] Trigger the blueprint manually: `POST /blueprints/{blueprintId}/trigger`. Run this step if you want to trigger the newly created blueprint right away. See an example request below:
+
+```shell
+curl --location --request POST 'http://localhost:8080/blueprints/<blueprintId>/trigger' \
+--header 'Content-Type: application/json'
```
## References
diff --git a/versioned_docs/version-v0.15/Plugins/bitbucket.md b/versioned_docs/version-v0.15/Plugins/bitbucket.md
index 97e7f2025d..e0dc2ec0d2 100644
--- a/versioned_docs/version-v0.15/Plugins/bitbucket.md
+++ b/versioned_docs/version-v0.15/Plugins/bitbucket.md
@@ -36,32 +36,66 @@ Metrics that can be calculated based on the data collected from bitbucket:
## Configuration
- Configuring Bitbucket via [Config UI](/UserManuals/ConfigUI/BitBucket.md)
-- Configuring Bitbucket via Config UI's [advanced mode](/UserManuals/ConfigUI/AdvancedMode.md#9-BitBucket).
## API Sample Request
+> Note: Please replace the `http://localhost:8080` in the sample requests with your actual DevLake API endpoint. For how to view DevLake API's swagger documentation, please refer to the "Using DevLake API" section of [Developer Setup](../DeveloperManuals/DeveloperSetup.md).
-You can trigger data collection by making a POST request to `/pipelines`.
+1. Create a Bitbucket data connection: `POST /plugins/bitbucket/connections`. Please see a sample request below:
```shell
-curl 'http://localhost:8080/pipelines' \
+curl --location --request POST 'http://localhost:8080/plugins/bitbucket/connections' \
--header 'Content-Type: application/json' \
---data-raw '
-{
- "name": "project1",
- "plan": [
- [
- {
- "plugin": "bitbucket",
- "options": {
- "connectionId": 1,
- "owner": "apache",
- "repo": "devlake",
- }
- }
- ]
- ]
-}
-'
+--data-raw '{
+ "endpoint": "https://api.bitbucket.org/2.0/",
+ "username": "<your username>",
+ "password": "<your app password>",
+ "name": "Bitbucket Cloud"
+}'
+```
+
+2. Create a blueprint to collect data from Bitbucket: `POST /blueprints`. Please see a sample request below:
+
+```shell
+curl --location --request POST 'http://localhost:8080/blueprints' \
+--header 'Content-Type: application/json' \
+--data-raw '{
+ "enable": true,
+ "mode": "NORMAL",
+ "name": "My Bitbucket Blueprint",
+ "cronConfig": "<cron string of your choice>",
+ "isManual": false,
+ "plan": [[]],
+ "settings": {
+ "connections": [
+ {
+ "plugin": "bitbucket",
+ "connectionId": 1,
+ "scope": [
+ {
+ "entities": [
+ "CODE",
+ "TICKET",
+ "CODEREVIEW",
+ "CROSS"
+ ],
+ "options": {
+ "owner": "<owner of your repo>",
+ "repo": "<your repo name>"
+ }
+ }
+ ]
+ }
+ ],
+ "version": "1.0.0"
+ }
+}'
+```
+
+3. [Optional] Trigger the blueprint manually: `POST /blueprints/{blueprintId}/trigger`. Run this step if you want to trigger the newly created blueprint right away. See an example request below:
+
+```shell
+curl --location --request POST 'http://localhost:8080/blueprints/<blueprintId>/trigger' \
+--header 'Content-Type: application/json'
```
## References