Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We鈥檒l occasionally send you account related emails.

Already on GitHub? Sign in to your account

馃搫 馃悰 Source Netsuite: check_connection fix + edited public docs #21645

Merged
merged 3 commits into from
Jan 21, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -1099,7 +1099,7 @@
- name: Netsuite
sourceDefinitionId: 4f2f093d-ce44-4121-8118-9d13b7bfccd0
dockerRepository: airbyte/source-netsuite
dockerImageTag: 0.1.2
dockerImageTag: 0.1.3
documentationUrl: https://docs.airbyte.com/integrations/sources/netsuite
icon: netsuite.svg
sourceType: api
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -9374,7 +9374,7 @@
supportsNormalization: false
supportsDBT: false
supported_destination_sync_modes: []
- dockerImage: "airbyte/source-netsuite:0.1.2"
- dockerImage: "airbyte/source-netsuite:0.1.3"
spec:
documentationUrl: "https://docsurl.com"
connectionSpecification:
Expand Down
2 changes: 1 addition & 1 deletion airbyte-integrations/connectors/source-netsuite/Dockerfile
Original file line number Diff line number Diff line change
Expand Up @@ -35,5 +35,5 @@ COPY source_netsuite ./source_netsuite
ENV AIRBYTE_ENTRYPOINT "python /airbyte/integration_code/main.py"
ENTRYPOINT ["python", "/airbyte/integration_code/main.py"]

LABEL io.airbyte.version=0.1.2
LABEL io.airbyte.version=0.1.3
LABEL io.airbyte.name=airbyte/source-netsuite
Original file line number Diff line number Diff line change
Expand Up @@ -21,18 +21,20 @@ class SourceNetsuite(AbstractSource):
logger: logging.Logger = logging.getLogger("airbyte")

def auth(self, config: Mapping[str, Any]) -> OAuth1:
# the `realm` param should be in format of: 12345_SB1
realm = config["realm"].replace("-", "_").upper()
return OAuth1(
client_key=config["consumer_key"],
client_secret=config["consumer_secret"],
resource_owner_key=config["token_key"],
resource_owner_secret=config["token_secret"],
realm=config["realm"],
realm=realm,
signature_method="HMAC-SHA256",
)

def base_url(self, config: Mapping[str, Any]) -> str:
realm = config["realm"]
subdomain = realm.lower().replace("_", "-")
# the subdomain should be in format of: 12345-sb1
subdomain = config["realm"].replace("_", "-").lower()
return f"https://{subdomain}.suitetalk.api.netsuite.com"

def get_session(self, auth: OAuth1) -> requests.Session:
Expand Down
60 changes: 35 additions & 25 deletions docs/integrations/sources/netsuite.md
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ This connector implements the [SuiteTalk REST Web Services](https://docs.oracle.
* Allowed access to all Account permissions options

## Airbyte OSS and Airbyte Cloud
* Realm
* Realm (Account ID)
* Consumer Key
* Consumer Secret
* Token ID
Expand All @@ -25,46 +25,55 @@ This connector implements the [SuiteTalk REST Web Services](https://docs.oracle.
#### Step 2.1: Obtain Realm info
1. Login into your NetSuite [account](https://system.netsuite.com/pages/customerlogin.jsp?country=US)
2. Go to **Setup** 禄 **Company** 禄 **Company Information**
3. Copy your Account ID. It will looks like **1234567** if you use regular account or **1234567_SB2** if it is a Sandbox
3. Copy your Account ID (Realm). It should look like **1234567** for the `Production` env. or **1234567_SB2** - for a `Sandbox`
#### Step 2.2: Enable features
1. Go to **Setup** 禄 **Company** 禄 **Enable Features**
2. Click on **SuiteCloud** tab
3. Scroll down to **Manage Authentication** section
4. Enable checkbox **TOKEN-BASED AUTHENTICATION**
5. Save changes
3. Scroll down to **SuiteScript** section
4. Enable checkbox for `CLIENT SUITESCRIPT` and `SERVER SUITESCRIPT`
5. Scroll down to **Manage Authentication** section
6. Enable checkbox `TOKEN-BASED AUTHENTICATION`
7. Scroll down to **SuiteTalk (Web Services)**
8. Enable checkbox `REST WEB SERVISES`
9. Save the changes
#### Step 2.3: Create Integration (obtain Consumer Key and Consumer Secret)
1. Go to **Setup** 禄 **Integration** 禄 **Manage Integrations** 禄 **New**
2. Fill the **Name** field. *It is a just description of integration*
3. **State** will keep **enabled**
4. Enable checkbox **Token-Based Authentication** on *Authentication* section
2. Fill the **Name** field (we recommend to put `airbyte-rest-integration` for a name)
3. Make sure the **State** is `enabled`
4. Enable checkbox `Token-Based Authentication` in **Authentication** section
5. Save changes
6. After that, **Consumer Key** and **Consumer Secret** will be showed once, copy them.
#### Step 2.4: Setup Role
6. After that, **Consumer Key** and **Consumer Secret** will be showed once (copy them to the safe place)
#### Step 2.4: Setup Role
1. Go to **Setup** 禄 **Users/Roles** 禄 **Manage Roles** 禄 **New**
2. Fill the **Name** field.
2. Fill the **Name** field (we recommend to put `airbyte-integration-role` for a name)
3. Scroll down to **Permissions** tab
4. You need to select manually each record on selection lists and give at least **Read-only** level access on the next tabs: (Permissions, Reports, Lists, Setup, Custom Records). You strongly need to be careful and attentive on this point.
5.
#### Step 2.5: Setup User
1. Go to **Setup** 禄 **Users/Roles** 禄 **Manage Users**
2. In column _Name_ click on the user鈥檚 name you want to give access
3. Then click on **Edit** button under the user鈥檚 name
4. (REQUIRED) Click on `Transactions` and manually `add` all the dropdown entities with either `full` or `view` access level.
5. (REQUIRED) Click on `Reports` and manually `add` all the dropdown entities with either `full` or `view` access level.
6. (REQUIRED) Click on `Lists` and manually `add` all the dropdown entities with either `full` or `view` access level.
7. (REQUIRED) Click on `Setup` and manually `add` all the dropdown entities with either `full` or `view` access level.
* Make sure you've done all `REQUIRED` steps correctly, to avoid sync issues in the future.
* Please edit these params again when you `rename` or `customise` any `Object` in Netsuite for `airbyte-integration-role` to reflect such changes.

#### Step 2.5: Setup User
1. Go to **Setup** 禄 **Users/Roles** 禄 **Manage Users**
2. In column `Name` click on the user鈥檚 name you want to give access to the `airbyte-integration-role`
3. Then click on **Edit** button under the user鈥檚 name
4. Scroll down to **Access** tab at the bottom
5. Select from dropdown list the role which you created in step 2.4
5. Select from dropdown list the `airbyte-integration-role` role which you created in step 2.4
6. Save changes

#### Step 2.6: Create Access Token for role
1. Go to **Setup** 禄 **Users/Roles** 禄 **Access Tokens** 禄 **New**
2. Select an **Application Name**
3. Under **User** select the user you assigned the _Role_ in the step **2.4**
4. Inside **Role** select the one you gave to the user in the step **2.5**
5. Under **Token Name** you can give a descriptive name to the Token you are creating
6. Save changes
7. After that, **Token ID** and **Token Secret** will be showed once, copy them.
3. Under **User** select the user you assigned the `airbyte-integration-role` in the step **2.4**
4. Inside **Role** select the one you gave to the user in the step **2.5**
5. Under **Token Name** you can give a descriptive name to the Token you are creating (we recommend to put `airbyte-rest-integration-token` for a name)
6. Save changes
7. After that, **Token ID** and **Token Secret** will be showed once (copy them to the safe place)

#### Step 2.7: Summary
You have copied next parameters
* Realm (Account ID)
* Realm (Account ID)
* Consumer Key
* Consumer Secret
* Token ID
Expand Down Expand Up @@ -105,7 +114,7 @@ The NetSuite source connector supports the following [sync modes](https://docs.a

## Supported Streams

- Streams are generated based on `ROLE` and `USER` access to them as well as `Account` settings, make sure you're using `Admin` or any other custom `ROLE` granted to the Access Token, having the access to the NetSuite objects for data sync.
- Streams are generated based on `ROLE` and `USER` access to them as well as `Account` settings, make sure you're using the correct role assigned in our case `airbyte-integration-role` or any other custom `ROLE` granted to the Access Token, having the access to the NetSuite objects for data sync, please refer to the **Setup guide** > **Step 2.4** and **Setup guide** > **Step 2.5**


## Performance considerations
Expand All @@ -116,5 +125,6 @@ The connector is restricted by Netsuite [Concurrency Limit per Integration](http

| Version | Date | Pull Request | Subject |
| :------ | :--------- | :------------------------------------------------------- | :-------------------------- |
| 0.1.3 | 2023-01-20 | [21645](https://github.com/airbytehq/airbyte/pull/21645) | Minor issues fix, Setup Guide corrections for public docs |
| 0.1.1 | 2022-09-28 | [17304](https://github.com/airbytehq/airbyte/pull/17304) | Migrate to per-stream state |
| 0.1.0 | 2022-09-15 | [16093](https://github.com/airbytehq/airbyte/pull/16093) | Initial Alpha release |